Hello Guest it is April 19, 2024, 10:12:02 PM

Author Topic: Is it possible to call an M code from a different M code?  (Read 2776 times)

0 Members and 1 Guest are viewing this topic.

Re: Is it possible to call an M code from a different M code?
« Reply #20 on: February 28, 2019, 06:31:32 PM »
Hi,
smurph is one of the lead developers of Mach4 and a seasoned programmer. He has repeatedly suggested to all and sundry
that each and every API call return code be tested. I'm slack and only do so when I get into trouble but there are certain
API's where if you don't test the return code you ARE IN TROUBLE......you don't know when but it WILL BLOW UP IN YOUR FACE.

One such API is mc.CntlGcodeExecuteWait(). Another is mcSignalWait. Having being burnt I usually always test them,
I know it adds complexity to the code but it works and saves grief.

The only time I tend not to test them is if the extra (seeming) code complexity will obscure the program logic, particularly
if I'm posting on the forum for others benefit. In that situation clear concise code with minimal clutter conveys the most
understanding. Code that I develop for my own machine includes multiple test points.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'