Logical.From
Creates a logical from the given value.
Syntax
Logical.From(
value as any
) as logical
Remarks
Returns a logical
value from the given value
. If the given value
is null
, Logical.From
returns null
. If the given value
is logical
, value
is returned. Values of the following types can be converted to a logical
value:
text
: Alogical
value from the text value, either"true"
or"false"
. Refer toLogical.FromText
for details.number
:false
ifvalue
equals0
,true
otherwise.
value
is of any other type, an error is returned.
Examples
Example #1
Convert <code>2</code> to a <code>logical</code> value.
Logical.From(2)
Result:
true
Category
Logical