Skip to main content

Convert-to-Logical-Data

Command Description

Convert data type to logical

Command Prototype

bRet = CBool(varData)

Parameter Description

ParameterRequiredTypeDefaultDescription
varDataTrueexpression$PrevResultData to be converted

return

bRet,The variable used to save the output of the command.

Demo

TracePrint("---------------------------- Convert to logical data------------------- --------") 
//--------------------------------------------------------------------------
//[Remarks] Convert data to logical type
//Input parameter 1:
// varData----->target data
//out parameters:
// Converted boolean value
TracePrint("Convert target data to boolean")
bRet = CBool("Hello UiBot")
TracePrint("Convert the string Hello UiBot to a boolean, the result is: ")
TracePrint(bRet)

bRet = CBool(0)
TracePrint("Convert the number 0 to a boolean, the result is: ")
TracePrint(bRet)