Hi Hood
Yes, I am definitely editing the right one.
How do I know? Because when I tried to use the edited version the system did not 'behave itself'; when I restored the old version (file name change) the system did behave itself (after I had posted). So Mach was seeing the file anyhow. Fortunately I was testing with soft plastic ...
From this I conclude that whatever edits I made caused Mach to reject the modified code ... OK, some progress.
Mind you, while I have been writing Basic for the last ... 30+ years, the inconsistencies in the doco leave me really wondering.
First of all, the M6End.m1s file seems to be written maybe on a Linux machine as it does not use <CR><LF> between the lines. So the file looks a trifle wrong in NotePad, although WordPad manages OK. Read ansd save in Wordpad without any edits and the record terminator changes so that Notepad can handle it. Ah, but can Mach handle both formats? Dunno.
The 'else' clause in M6End.m1s contains this: Code"G00 X" & x & "Y" & y - withOUT any brackets. That is hardly 'Basic'. The example in the Macro Programming Reference doc (Draft rev 0.18) shows (for example) Code(“G00 X-4.000 Y1.000 Z1.000”), with brackets. Conventional basic. I have tried both.
What I did was change the else clause to restore the starting Z position first. So it went from this:
else
Code"G00 X" & x & "Y" & y
end if
to this:
else
code("G0 z" & z)
Code("G00 X" & x & "Y" & y)
end if
In the event, neither G0 instruction seems to have been acted upon.
It's evening here. I will try all this again in the morning using the Mach VB editor, to see whether that makes any difference.
Cheers