<< Click to Display Table of Contents >> Navigation: 3. Script Language > Variable Definitions and Operations > Variable Commands |
MiniRobotLanguage (MRL)
VFP. Command
Variable Floating Point
Intention
This command can be used to assign a Floating Point numeric Value to a Variable.
Such Floating Point Variables have a range of approximately +/- 3.4*10^-4932 to 1.2*10^4932,
and offer up to 18 digits of precision
Unlike VAN. there is only a limited Resolution, therefore this Command is faster.
Also it will generate a Variable of Type "FP" (Type 5 see GVT.) to prevent rounding Errors.
Specialfolders are not resolved. Systemvariables are not resolved.
Also VFP. will not do a numeric resolution which possibly includes calculations, that makes it faster then VAN..
VFP. Was designed to make a faster Command and to make sure you get a FP.-Type 5 Variable to prevent rounding Errors.
VAR, will generally make a Type 1 . String Variable.
'This will set the variable to zero:
VFP.$$ABC=0
VFP.$$ABC=
You can assign Hexadezimal, octal or binary, floating point and negative numbers to a variable using VFP.
' Hexadezimal assignement
VFP.$$ABC=&h90
' Binary assignement
VFP.$$ABC=&B0100101101
' Octal assignement
VFP.$$ABC=&O4574514
' Negative numbers and floating point numbers
VFP.$$ABC=-25.004
' Do not use System-variables with VFP.
VFP.$$XPO=#iw#*2
You can not assign the result of a formula to a variable using VFP.
' This will not work and therefore assign the value of zero to the variable
VFP.$$ABC=(4*5.1+(8*8))
Concatenation will work with VFP.
Syntax
VFP.P1=P2
VFP.P1+P2
Parameter Explanation
P1 - Variable-name
P2 - Value/or Variable that will be assigned to the variable.
If P2 is omitted, the variable will be set to "0".
Speed in Ticks:
This command uses typically between 110 and 240 Ticks.
Example
'**********************************
' VFP.
'**********************************
'This will set the variable to zero:
VFP.$$ABC=0
VFP.$$ABC=-25.004
' Hexadezimal assignement
VFP.$$ABC=&h90
' Binary assignement
VFP.$$ABC=&B0100101101
' Octal assignement
VFP.$$ABC=&O4574514
' This will not work and assign "0" to the variable
' Because VFP. deos not make calculations
VFP.$$ABC=(4*5.1+(8*8))
END.
'**********************************
Remarks
-
Limitations:
Binary, octal and hexadezimal numbers can not be negative and they can not be floating point numbers.
See also:
• VAR. - Variable Set Value/Clear
• VAV. - Variables with Variables
• VBA. - Variable Binary Append
• CAL. - mathematical CALculation