Boolean (Json function)

From m204wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Create a Boolean JSON object (Json class)

[Introduced in Model 204 7.6]


This function creates a Json object of the boolean type.

Syntax

%json = [%(Json):]Boolean( boolean)

Syntax terms

%jsonJson object
[%(Json):] The optional class name in parentheses denotes a virtual constructor. See "Usage notes", below, for more information about invoking a virtual constructor.
boolean Boolean value

Usage notes

  • To assign a literal True or False to a Json object use the True or False Json function.
  • As with all virtual or true constructors, it is usually not necessary to specify the %(json): before the Boolean method. That is %json = %(json):boolean(true) is equivalent to %json = boolean(true).

Examples

The following creates a Json object whose value is the result of a comparison:

%json is object json %war is float %peace is float ... %json = boolean(%war eq %peace)

See also