iDevOS CALC "VEXISTS" Command
See if an entity exists (name contained in a variable)
Description
CALC( y, src, "VEXISTS" ); // y = exists(src) = does entity name in src exist?
This command checks to see if the entity name given in the text variable src
exists, ie has been created. The value y
will be set to 1
if the entity exists or 0
if it does not.
A test for the existence of an entity whose name is provided directly can also be tested using "EXISTS"
.
Parameters
y
- Calculation result.
Parameter type: entity name of a numeric variable (egU8
,S32
,FLT3
etc). name
- Entity Name.
Parameter type: immediate entity name of a text variable. "VEXISTS"
- CALC command operator.
Parameter type: immediate string.
Examples
Example 1
VAR(res, 0, U8); // Result VAR(name, "test", TXT); // Variable to test // Assume the entity test has not been created. CALC(res, name, "VEXISTS"); // res = 0 // Create the entity test. VAR(test, 99, U8); CALC(res, name, "VEXISTS"); // res = 1