Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: patton on February 20, 2015, 11:09:30 AM

Title: Lua Question
Post by: patton on February 20, 2015, 11:09:30 AM
Hello All,
  Is there some way to put 2 functions in a script and be able to choose which function you want to run using a checkbox control and it would run one or the other but not both?  I am not a computer programmer at all.

Thanks
Dave
Title: Re: Lua Question
Post by: BR549 on February 20, 2015, 12:39:52 PM
Yes there is you can use a normal Message box and a IF then statement to look at the respond IF yes then do one else do the other. That keeps it simple.

Beware IF you do not compose it all correctly it can cause KAOS with mach4. I learned that the hard way with SheetCam. One wrong piece of code (1 line) brought down the entire program.

Beware untill we get proper documentation on the structuring of LUA in Mach4.

Just a thought, (;-) TP
Title: Re: Lua Question
Post by: patton on February 21, 2015, 07:02:42 AM
I tried using the "IF then" with a "goto" and a label but it doesn't ever got to the first function it will just skip over the first function and go to the second function.

Thanks
Dave