2711
General Mach Discussion / Re: using variables
« on: July 13, 2013, 10:12:12 AM »
HIYA Gary, Yes the #vars have full math functions, see the Mach3 manual for details.
To create a -#var
If #100 equates to 10 BUT you need to move in a neg direction
X -#100
You Would
X= [-1*#100] or
X=[0-#100]
You can always use a neg number IF the "value" is already neg
#100 =-10 Works fine
SUBS, now that is not one of MAch3 strong points. IF kept simple and not deeply nested they work OK.
With your example with drilling holes the use of a #var for depth has not saved you any steps. You still have to declare the variable so you might a s well just use the real number. Actually it is LESS steps to just declare the value because you do not have to declare the #var value then apply it.
BUT as I always say IF it works for you then use it (;-).
(;-) TP
To create a -#var
If #100 equates to 10 BUT you need to move in a neg direction
X -#100
You Would
X= [-1*#100] or
X=[0-#100]
You can always use a neg number IF the "value" is already neg
#100 =-10 Works fine
SUBS, now that is not one of MAch3 strong points. IF kept simple and not deeply nested they work OK.
With your example with drilling holes the use of a #var for depth has not saved you any steps. You still have to declare the variable so you might a s well just use the real number. Actually it is LESS steps to just declare the value because you do not have to declare the #var value then apply it.
BUT as I always say IF it works for you then use it (;-).
(;-) TP