ParseStringAsBoolean
Type
statement
Summary
Parses a string as a boolean value
Syntax
parse <Operand> as boolean
Description
Use StringParsedAsBoolean when you want to determine if a string contains "true" or "false"
note
Only the strings "true" and "false" will parse to give a boolean value. Any other input will cause an error to be thrown.
Parameters
Name | Type | Description |
---|---|---|
Operand | An expression that evaluates to a string. |
Examples
variable tString as String
variable tBool as optional Boolean
combine ["f", "a", "l", "s" "e"] with "" into tString
put tString parsed as boolean into tBool -- tBool contains false
variable tResult as String
variable tCheck as optional Boolean
parse "sdfsdf" as boolean into tCheck
if tCheck is nothing then
put "not a valid boolean" into tResult
end if