Tom,
When I started off with CNCLite, I could not figure out any method of writing logic in the gcode.fil and have any guarantee about when it would execute. That is to say, I believe that there is certain logic built in to CNCLite that executes some sort of rudimentary, but hidden commands. So this begs the question, does the logic you add to the gcode file execute before or after the Camsoft logic (whatever it is?) I could be wrong, or things may have changed since back then. Also, using variables is a bit of a crapshoot when you don't know what ones are in use, and how they are used.
So, that is why I went to CNC Professional, because then, what you see in your gcode file is what gets executed.
Basically, G98 and G99 have to store an axis position for your G8x cycles. So there has to be a common variable used in your G8x macros, and in the G98, G99 to store and recall a particular position at a particular moment. The Z axis would normally be positioned at the rapid plane before calling the cycle. A clearance plane (R is the common standard definition) is defined as well, and the movement between the Rapid plane and the R plane is executed at rapid speed before the feed drilling motions begin.
So for example you might have a Rapid plane of Z1.0" and a clearance plane of R.05, while the actual part surface begins at Z0.
With G98, the cycle completes a hole, and the tool retracts to the Rapid plane.
With G99, the cycle completes one hole but then the tool rises only to the R plane, followed by a movement to the next hole. So this saves a bit of extra motion and time.
Standard type format for these cycles might look like this:
G98 G81 Z-1. R0.05 F4.
G99 G81 Z-1. R0.05 F4.
Now in practice, when you use a G99, you might want to end the last hole by calling the drill cycle once more, with a G98, in order to get the drill back up to the Rapid plane. However, in most CAM systems, the tool motion can be programmed (in the post) to return the tool to the Rapid plane anyways, so this saves you the trouble of doing what I just stated.
First you get good, then you get fast. Then grouchiness sets in.
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)