I need help to determine why a 3 or 4 line macro, in mach3 (final version) , won't run without compile or syntax errors. Single code snippets run fine! (GetVar, SetVar, Code"xxx")
But as soon as I embed a snippet in a simple " If-Then-End If" construct, I get a compile error at the time of the macro execution.
Example M888: Runs without errors: reads/writes #Vars in G code program verified with "Operator/Var monitor"
SetVar(100, GetVar(101)+3) M99
Example M888: Faults on runtime execution, issues "Compile error"
If GetVar(103) > GetVar(104) Then
SetVar(100, GetVar(101)+3)
End If
M99
Running the debugger produces a compile and syntax error but no reference to the offending line or instruction.
Another oddity:
Works: SetVar(100, GetVar(101)+3) M99
Faults: SetVar(100, GetVar(101)+3)
M99
Can't figure out why moving M99 would make a difference