Boolean (Json function): Difference between revisions
Jump to navigation
Jump to search
(Automatically generated page update) |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Template:Json:Boolean subtitle}} | {{Template:Json:Boolean subtitle}} | ||
This | This function creates a Json object of the boolean type. | ||
==Syntax== | ==Syntax== | ||
{{Template:Json:Boolean syntax}} | {{Template:Json:Boolean syntax}} | ||
Line 13: | Line 13: | ||
</table> | </table> | ||
==Usage notes== | ==Usage notes== | ||
<ul> | |||
<li>To assign a literal True or False to a Json object use the [[True (Json function)|True]] or [[False (Json function)|False]] Json function.</li> | |||
<li>As with all virtual or true constructors, it is usually not necessary to specify the <code>%(json):</code> before the Boolean method. That is <code>%json = %(json):boolean(true)</code> is equivalent to <code>%json = boolean(true)</code>.</li> | |||
</ul> | |||
==Examples== | ==Examples== | ||
The following creates a Json object whose value is the result of a comparison: | |||
<p class="code">%json is object json | |||
%war is float | |||
%peace is float | |||
... | |||
%json = boolean(%war eq %peace) | |||
</p> | |||
==See also== | ==See also== | ||
{{Template:Json:Boolean footer}} | {{Template:Json:Boolean footer}} |
Latest revision as of 18:38, 18 February 2015
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
%json | Json 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)