from VB script documentation:
SetVarSub SetVar(VarNum As Integer, Val As Double)
This function sets the Mach variable specified by VarNum to the value given by Val.
Mach variables are accessible both to CB scripts, using the SetVar() and GetVar()
functions, as well as G-code programs, using the #nnnn syntax.
Arguments:
VarNum is Integer the number of the Mach variable to be set.
Val is the Double value to which the variable will be set
Return Value:
None
Example:
‘ Set a variable 1234 to our target position of 2.3456
SetVar(1234, 2.3456)
‘ Now move X to our target position
Code “G0 X #1234”
See also:
GetVar()
https://www.machsupport.com/wp-content/uploads/2013/02/Mach3_V3.x_Macro_Prog_Ref.pdf