I've had the idea of encoding some extra information from my vb6 gcode generator into my gcode files by having it write them into a gcode comment line (on line 8 in this particular case), with the idea that a macro might then be able to read them and assign their values to persistent variables in mach xml. This seems less complicated to me than my original idea of trying to get my vb6 app to write to mach's xml directly.

Can a macro 'read' a line of my gcode file, and use what it finds, without me having to write in line numbers for it to refer to? I'm not sure what approach to take with this; maybe using carriage returns as delimiters for an array made out of the first 8 lines, and then break the 8th element into its usable parts. Does Cypress Basic do this? Or is there a better approach to this problem?

Even IF you wrote to the XML it would not be available until Mach3 restarts again as the Original is loaded on start up and only saved on close (unless you force a save). Better to write to a #var(500-600) and it get saved . That way it is available as the current #var AND will be available on open.

That I am aware of you cannot access the ERROR (status) label from CB . That( GetErrorLabel() ) was never brought out. I tried years ago to get it done BUT no dice. It would have been very handy as you have noticed (;-) SO if someone else knows a way I am all ears as well.

My VB6 app saves the 3 values I need in the registry, but accessing that from a macro is not straightforward, so I wrote a sub in the VB app that saves the same 3 values, delimited by commas, into a .txt file in Mach3 folder, and into a comment line in the gcode if necessary, which it isn't anymore....