Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 02:26:06 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Problem in M6 macro, needs help!
Pages: 1   Go Down
Print
Author Topic: Problem in M6 macro, needs help!  (Read 453 times)
0 Members and 2 Guests are viewing this topic.
kadettevo
Active Member

Offline Offline

Posts: 2


View Profile WWW
« on: May 14, 2010, 04: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 Cheesy

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

Or can it be solved in another way??

* M6Start_kadettevo.m1s (1.98 KB - downloaded 109 times.)
Logged

//Johan Marquardt
DaveCVI
V4 Screen Contributor

Offline Offline

Posts: 532



View Profile WWW
« Reply #1 on: May 14, 2010, 05: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.

Dave
Logged

Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!