Hello Guest it is November 27, 2021, 02:48:28 PM

Author Topic: Macro from MDI  (Read 386 times)

0 Members and 1 Guest are viewing this topic.

Offline dhelf

*
  •  10 10
    • View Profile
Macro from MDI
« on: August 08, 2019, 06:57:21 PM »
I have tried to search the forum so as not to ask redundant questions, but did not find much. How can a macro work perfect in the editor, but not finish from the MDI? It is saved as an mcs extension. At the moment this is on a demo, does that have something to do with it?
Thanks

Offline smurph

*
  • *
  •  1,475 1,475
  • "That there... that's an RV."
    • View Profile
Re: Macro from MDI
« Reply #1 on: August 14, 2019, 12:49:12 AM »
It is probably a case issue.  The macron filename needs to be lower case.  We will use m103 for the macro name for this example.  So "m103.mcs" (correct) vs. M101.mcs (incorrect).  Then, inside the file, there should be a function called m103().  This function should also be lower case.  Finally, the the stub code InEditor needs to call the lower case m103() function.

In summary, just lower case the filename and function name.  If either is upper case it will run in the editor but not in MDI or a G code file.  (Sound familiar?)  Oh, and the function name and filename had better match.  For example, you don't want a filename of m103.mcs and have a function inside it named m102(). 

Steve