Skip to content


Creates a bool object from a string. The resulting value is a bool depending on whether the given string is falsey or not.

"Falsey" is defined as any of the following values:

  • Empty String
  • NULL
  • The string "0"

If the string is one of these values, the resulting bool is false. Otherwise, it is true.


bool Bool[Text]

Converts the given Text to a bool based on the rules presented above.

Usage Examples

/declare MyVar bool
/varset MyVar ${Bool[This is true]}

| prints TRUE
/echo ${MyVar}

/varset MyVar ${Bool[NULL]}

| prints FALSE
/echo ${MyVar}
local myVar

-- prints true
myVar = mq.TLO.Bool('This is true')()

-- prints false
myVar = mq.TLO.Bool('NULL')()