strtoint()是把字符转换成整型,那把字符转换成布尔型怎么转换?

解决方案 »

  1.   

    UnitSysUtilsfunction StrToBool(const S: string): Boolean多看看帮助~
      

  2.   

    DescriptionStrToBool converts the string specified by S to a boolean. If S can be converted to a number, StrToBool returns False if that number is 0, True otherwise. If S can抰 be converted to a number, StrToBool returns True if S is any of the strings listed in TrueBoolStrs (or differs from one only by case) and False if it is any of the strings listed in FalseBoolStrs (or differs from one only by case). If S is not a number and not one of the strings listed in TrueBoolStrs or FalseBoolStrs, StrToBool raises an EConvertError exception.Note: If you do not assign a value to TrueBoolStrs, it is treated as if it contains the single string 慣RUE? Similarly, if you do not assign a value to FalseBoolStrs, it is treated as if it contains the single string 慒ALSE?
      

  3.   

    DescriptionStrToBool converts the string specified by S to a boolean. If S can be converted to a number, StrToBool returns False if that number is 0, True otherwise. If S can抰 be converted to a number, StrToBool returns True if S is any of the strings listed in TrueBoolStrs (or differs from one only by case) and False if it is any of the strings listed in FalseBoolStrs (or differs from one only by case). If S is not a number and not one of the strings listed in TrueBoolStrs or FalseBoolStrs, StrToBool raises an EConvertError exception.Note: If you do not assign a value to TrueBoolStrs, it is treated as if it contains the single string 'TRUE' Similarly, if you do not assign a value to FalseBoolStrs, it is treated as if it contains the single string 'FALSE'.