Converts a string to a Boolean value, with a Boolean success code.
function TryStrToBool(const S: string; out Value: Boolean): Boolean;
Boolean TryStrToBool(const AnsiString S, Boolean Value);
SysUtils
TryStrToBool converts the string specified by S to a Boolean and sets Value to the result. If S can be converted to a number, TryStrToBool sets Value to false if that number is 0, true otherwise. If S can't be converted to a number, TryStrToBool 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, TryStrToBool returns false to indicate that the conversion failed. If the conversion is successful, TryStrToBool returns true.
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|