Hello Guest it is January 28, 2022, 03:04:00 AM

Author Topic: Problem in M6 macro, needs help!  (Read 2289 times)

0 Members and 1 Guest are viewing this topic.

Problem in M6 macro, needs help!
« on: May 14, 2010, 05:54:18 PM »
I have a compilation problem in my M6 macro (attached) i have a Select Case statement
in there to select the nexttool to be inserted, and the case activates or deactivates outputs as binary code for
may PLC, but i cant compile it when i have the Select case statement... If i delete it i can, but of course the macro doesn't work :D

So any one out there, WHAT I'm doing wrong????

Or can it be solved in another way??
//Johan Marquardt
Re: Problem in M6 macro, needs help!
« Reply #1 on: May 14, 2010, 06:27:51 PM »
At first glance, the problem does not appear to be the select statement.

1) Format the indenting so you can see what is going on - when you do, you'll notice that there are at least 3 If statements which don't have corresponding "end if"s. Fix that first, then see if the syntax errors clear up.

2) make the first line of the script be "Option explicit" - then declare all the variables you use.
Implicitly declaring variables on the fly will get you in trouble sooner or later - all it takes is one typo.

Author of the MachStdMill Extensions for Mach3