binEnum
This function is used by Ignition's Expression language.
Description​
This function, whose name stands for "binary enumeration," takes a list of booleans, and returns the index (starting at 1) of the first parameter that evaluates to true.
Syntax​
binEnum(value, [value, ...])
Parameters​
Type | Parameter | Description |
---|---|---|
Boolean | value | A value that represents a bit. Each argument can be either 0 (false) or a non-zero value (true). |
Returns​
- Integer - The index (starting at 1) of the first value that evaluates to true. If no value evaluates to true, the result is 0.
Examples​
Code Snippet
binEnum(0, 1, 0) //returns 2
Code Snippet
binEnum(0, false, 15, 0, 23) //returns 3 (the index of the 15 - any non-zero number is "true")