<< Click to Display Table of Contents >> Navigation: 3. Script Language > Variable Definitions and Operations > Variable Commands |
MiniRobotLanguage (MRL)
VAV. Command
VAriables with Variables
Intention
This command can be used to assign a Value to a Variable.
It will resolve variables that are with a given variable up to any Level.
The normal VAR. command does not touch already resolved variable bytes, to be binary compatible to some degree, and to avoid dead-locks.
VAV. will also resolve special folders and variables to MaxVarRes which is 255 by default. MaxVarRes is set using the OPT.-command). Lets see an example:
'**********************************
' VAR. / VAV. comparison
'**********************************
VAB.$$TXA=Theo
VAB.$$TXB=$$TXA
VAB.$$TXC=$$TXB
VAV.$$TXD=$$TXC
DBV.$$TXD
' VAV. returns "Theo"
VAR.$$TXD=$$TXC
DBV.$$TXD
' VAR. returns "$$TXB"
END.
'**********************************
As you can see, VAR. does not resolve to any depth, while VAV. will.
If there are variables that will resolve to variables which resolve to variables in a circular way, VAV. may resolve again and again until MaxDepth is reached. See this example:
'**********************************
' VAR. / VAV.
'**********************************
'
' We set maximum resolution depth for variables
' to 255 (which is the default value)
OPT.MaxVarRes|255
VAB.$$TXA=Theo $$TXB
VAB.$$TXB=$$TXA
VAV.$$TXD=$$TXB
DBV.$$TXD
' VAV. returns "Theo Theo Theo Theo Theo Theo Theo Theo" etc.
VAR.$$TXD=$$TXB
DBV.$$TXD
' VAR. returns "$$TXB"
END.
'**********************************
Please see the difference in the example below.
Syntax
VAV.P1=[P2]
Parameter Explanation
P1 - Variable-name
P2 - Value that will be assigned to the variable. If P2 is omitted,
the variable will be set to empty.
Example
'**********************************
' VAV.
'**********************************
VAB.$$TXA=Theo
VAB.$$TXB=$$TXA
VAB.$$TXC=$$TXB
VAV.$$TXD=$$TXC
DBV.$$TXD
END.
VAR.$$ABC=->$$AAA
MBX.$$ABC
Remarks
Its important to understand that the VAV.-Command should not be used for binary content which is for example loaded using CFF. Use VAB. or VAO or even VAR. instead.
Limitations:
-
See also:
• VBA. - Variable Binary Append
• VAR. - Variable Set Value/Clear
• VAV. - Variables with Variables
• CAL. - mathematical CALculation