I'm running the final release of Mach3. I want to create simple custom macros to facilitate parametric programming. Examples listed in the macro reference manual use vb conditional scripting, i.e. if-then-else, case, looping, etc. I can get simple code snippets to compile and work. Example, for reading/ setting #Vars in the g code program, a custom script (example M888.m1s with this snippet SetVar(100, GetVar(103)+3) runs fine and I verify results using the "Operator/ Var monitor) to visually see the results. As soon as I embed this within a conditional construct Say,

If someint = target then
SetVar(100, GetVar(103)+3)
End if

I get compile and syntax errors. There are many script examples, using conditional logic, provided in the Mach2 and Mach3 documentation. The debugger doesn't provide any clues as to line# or instruction that's causing the error.

Any help will be appreciated. Thanks!