Delphi 7 下可以。怎么回事?

解决方案 »

  1.   

    D6你找找看有没有这个函数.或都定义的单元你没有USES进出.
      

  2.   

    D6好像不支持这样的转换,StrToBool的参数必须是可以转换成数字的字符串,D7没试过
      

  3.   

    D6下是这样:
    StrToBool('0') := False
    StrToBool('1') := True
      

  4.   

    我的D6可以用strtobool('true'),没问题啊,
    uses SysUtils;
      

  5.   

    Converts a string to a boolean value.UnitSysUtilsCategorytype conversion routinesfunction StrToBool(const S: string): Boolean;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't 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';