Yes you can substitute a variable for the Q parameter. I have not found anything weird in the #var , the exception being it does NOT recognise a stated negative value such as -#100 , You have to convert the value to a _value by -1* or 0- before MAch3 will recognise it as such.
BUT the Q does not control hole depth it controls the peck distance.
In your case you would not see any advantage to using the #var you have to change the location values for each hole and when you do just specify a new Q value.
G83 X0 Y0 Z-1 Q.010 R.050 F10
X1 Q.020
X2 Q.030
etc,etc
(;-) TP
TP,
I was just using Q as an example, couldn't remember what it controlled. I used to program for a couple of Fadals and I had a variable I called Z Safe. At the beginning of every program I'd set it to like 6" which would let the operator run the program in the air above the part, and clear all the clamps and such. Once he had everything correct he just changed it to a safe but fast number.
I also used variables to pass data into sub routines. In your example the locations only get used one time. I would put all the hole locations in a sub routine. Then I'd spot drill using a 90 degree point drill to a depth equal to the radius of the finished hole. Since the tip is slightly flat you get a nice chamfer. Then I'd drill it, calling the same sub routine with variables set outside the sub. Then I might drill it again, using the same sub, changing the variables again.
Which brings up another question. You mention using Q=0-1 to get a negative value. Does that imply that Mach also does some math functions in addition to add, subtract, and multiply? I once wrote a short 50 line program that cut a 15 degree tapered pocket 12" x 18" x 7" deep with corners rounded out to clear a square cornered insert using variables and some trig. We tested it with a tiny ball mill on a small block of aluminum, then changed the variables and ran the big block. 200 passes to rough with a shell mill, 700 passes to finish with a ball mill!
I'm very rusty at this point and trying to get back up to speed with my home built machine.
Gary H. Lucas