SetBool: Difference between revisions

From Compost Wiki
Jump to navigation Jump to search
Jeffm (talk | contribs)
Created page with "==SetBool?('n', BOOLEAN_RESULT)== {{Description|description=This command will set the value of a named Boolean variable 'n' to the value of the specified Boolean Result. This ..."
 
Dannym (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
==SetBool?('n', BOOLEAN_RESULT)==
==SetBool('n', BOOLEAN_RESULT)==
{{Description|description=This command will set the value of a named Boolean variable 'n' to the value of the specified Boolean Result. This variable is defined in the global scope.}}
{{Description|description=This command will set the value of a named Boolean variable 'n' to the value of the specified Boolean Result. This variable is defined in the global scope.}}
{{Stats|id=837|type=Number|class=All Machines|scope=|version=11.0}}
{{Stats|id=837|type=Number|class=All Machines|scope=|version=11.0}}
==Example==
Instead of writing this...
IF [[FirstOperation|FirstOperation?]]
  [[SetFlag]]('IWishIDidntHaveToGoFirst')
ELSE
  [[SetFlagF]]('IWishIDidntHaveToGoFirst')
END
you can use SetBool to write it like this...
SetBool('IWishIDidntHaveToGoFirst', [[FirstOperation|FirstOperation?]])
==Notes==
==Notes==
This command is similar to [[SetFlag]] and [[SetFlagF]] but it uses the result of a Boolean command or test, in this way it works more like [[SetVar#]]. It can be used to store the state of boolean commands or tests with out having to set the flag in an [[IF]] test.
This command is similar to [[SetFlag]] and [[SetFlagF]] but it uses the result of a Boolean command or test, in this way it works more like [[SetVar#]]. It can be used to store the state of boolean commands or tests with out having to set the flag in an [[IF]] test.
[[Category:Output Control]]
[[Category:Output Control]]

Latest revision as of 23:58, 11 January 2016

SetBool('n', BOOLEAN_RESULT)

Description

This command will set the value of a named Boolean variable 'n' to the value of the specified Boolean Result. This variable is defined in the global scope.


Stats

ID 837
Type Number
Class All Machines
Min Version 11.0

Example

Instead of writing this...

IF FirstOperation?
  SetFlag('IWishIDidntHaveToGoFirst')
ELSE
  SetFlagF('IWishIDidntHaveToGoFirst')
END

you can use SetBool to write it like this...

SetBool('IWishIDidntHaveToGoFirst', FirstOperation?)

Notes

This command is similar to SetFlag and SetFlagF but it uses the result of a Boolean command or test, in this way it works more like SetVar#. It can be used to store the state of boolean commands or tests with out having to set the flag in an IF test.