<< Click to Display Table of Contents >> Navigation: 3. Script Language > Variable Definitions and Operations > Variable Commands |
MiniRobotLanguage (MRL)
IEV. / NEV.Conditional Statement
If exists Variable
Intention
Conditional Statement.
Test if a specified Variable exists.A Variable exists after it was defined anywhere in a Script. It does not matter if the content of the variable is zero, or if the variable is empty. Once it was defined, it exists.
A Variable can not be deleted, it will exist as long, as the Script runs.
Let's see an example:
' Here we define a Variable
VAR.$$ERT=15.05
IEV.$$ERT
DBP.Variable exists
ELS.
DBP.Variable NOT exists
EIF.
' Now we trry with a Variable that was not defined before.
IEV.$$ERX
DBP.Variable exists
ELS.
DBP.Variable NOT exists
EIF.
ENR.
As expected, the result is:
[00:07:24] Variable exists
[00:07:25] Variable NOT exists
You can only test for one Variable per command.
NEV. is the negative Form of IEV.
Syntax
IEV.P1 ELS. … EIF.
NEV.P1 ELS. … EIF.
Parameter Explanation
P1 - Variable to test for. The variable can not be inside another
variable, always directly the given variable is tested.
IXX.'s can be nested to unlimited Depth, and they can also enclose Sub-Program Calls or FEX. (Enumerations) to unlimited Depth.
Example
'***********************************
' IEV./EIF.-Sample
'***********************************
' Here we define a Variable
VAR.$$ERT=15.05
VAR.$$RTT=A
IEV.$$ERT
DBP.Variable exists
ELS.
DBP.Variable NOT exists
EIF.
' Now we trry with a Variable that was not defined before.
IEV.$$ERX
DBP.Variable exists
ELS.
DBP.Variable NOT exists
EIF.
ENR.
Remarks
-
Limitations:
-
See also: