BooltoFloString
BooltoFloString differs from the similar function called BoolToStr.
BooltoFloString converts a boolean response into a string, where Y will be returned for True, and N returned for False.
BooltoFloString may be easier to use in some circumstances. Please also refer to BoolToStr.
Please also refer to FloStringToBool for the opposite function.
Declaration: Function BooltoFloString(const aValue : boolean): string;
Several examples are detailed below.
procedure
ScriptEvent(
var
Value:Variant);
var
TheText, FullText, Which, Which2 :
string
;
BoYN :
boolean
;
begin
ConfYN := IsApplicationRunning(
'designer.exe'
);
//TRUE so "Y" is returned
TheAnswer := BooltoFloString(ConfYN);
LogInfo(TheAnswer);
If
ConfYN =
true
then
LogInfo(
'Yes its TRUE'
)
else
LogInfo(
'No it is FALSE'
);
LogInfo(
''
);
ConfYN := IsApplicationRunning(
'manager.exe'
);
//FALSE so "N" is returned
TheAnswer := BooltoFloString(ConfYN);
LogInfo(TheAnswer);
If
ConfYN =
true
then
LogInfo(
'Yes its TRUE'
)
else
LogInfo(
'No it is FALSE'
);
LogInfo(
''
);
end
;