Test if the string is a Boolean
Member of Compatible Unicode Intrinsic Functions (PRIM_LIBI.ICompatibleUnicodeIntrinsics)
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) Endif
This is equivalent to writing
Case (#String) When (= Y) #Button.enabled := True When (= N) #Button.enabled := False Endcase
Febuary 18 V14SP2