Unicode Intrinsic Functions - IsBoolean Method

Test if the string is a Boolean

Member of Unicode Intrinsic Functions (PRIM_LIBI.IUnicodeIntrinsics)


Name Type Data Type Description
Result *Result (Optional) Boolean True if the variable is a valid Boolean
FalseCaption *Input (Optional) Unicode String Value to use for the false value
TrueCaption *Input (Optional) Unicode String Value to use for the true value


IsBoolean tests a string to determine whether it can be used as a boolean. The TrueCaption and FalseCaption parameters define the allowable values for the Boolean.
IsBoolean will often be used before AsBoolean to trap a potential run time error.
If no input parameters are specified, the function expects values of True or False.


In this example, isBoolean expects a value of N or Y
If (#String.IsBoolean(N Y))
   #Button.Enabled := #String.IsBoolean(N Y)
This is equivalent to writing
Case (#String)
When (= Y)
   #Button.enabled := True
When (= N)
   #Button.enabled := False

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020