Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: hitchhiker on June 17, 2022, 08:24:08 AM
-
Hi guys...
i build a lathescreen.
now i have on 3 sites the same button with the same code...
if i want to change something on the code i must copy&past it to all 3 sites...
is there a way to to make changes in a .m1s file?
my attemp was:
button starts oem code 34 (basic script)
in the line for the script i put in :
Code "Button1.m1s"
then i make a file in the correct directory with the name Button1.m1s
to test it i put in the file :
Code "F300"
i get error when i hit the button in mach3....
if i name the file M4444
and change on the button from button1.m1s to m4444.m1s it works.
what do i wrong?! thanks
-
have a look to this:
https://www.machsupport.com/wp-content/uploads/2013/02/Mach3_V3.x_Macro_Prog_Ref.pdf
and then look for #Expand maybe this help's
-
Thanks.. yes i read it but i dont understand it...
my solution is to use m4444 for the code... but i hope someone have a example what i understand :)
thanks
-
you create a macrofile in the holder c:\Mach3\macros\Your profile name
let's say MyFuntions.m1s
in the file MyFuntions.m1s you place a function with the code:
'function for button1 ------------------------------------------------
Function Button1() as Boolean
Code ("F300")
End Function
now in any button you can use this code:
Sub Main()
Call Button1()
End Sub
#Expand <\..\..\macros\Your profile name\MyFunctions>
so you can keep the specific code in just one file -> MyFunctions.m1s
and you can add as may functions you want.
-
ok thanks! i will try it!
-
works perfect! Thanks!!!!