Terry -
See below
Dave
DAVE if in VB I say DoOembutton(100) I can get a Machfunction. The question was can you create your own OemButton()
[DB]: No - you (user) can't. OEMButton #s can only be created by changes to the mach sources.
to do a function(not an internall mach function) AND it be callable from VB
[DB]: You can create a function that is callable from a Cypress Basic script
(Yes, I am playing Don Quixote and using my lance to tilt at this wind mil

Mach does not implement VB scripts - it implements Cypress Basic scripts. While similar, they are different language specifications. Sorry, it's not you, but I'm tired of questions that result from people calling cats dogs and then wondering why they don't bark....).
or BRAINS for that matter.
[DB]: I'll skip brains calling scripts for now - that's a whole 'nother ball game... and one I have not looked at in some time so I don't really remember the possible brains to scripts connections.
That way you only create the piece of code once
[DB]: You can create it once, and you can store it in one place, and you can call that single copy of the script from any other script, and it will be called in a straight sequential fashion (not an async execution). This is enabled by the new facilities in 3.43.6+ Get the latest programmer docs from the doc page and look up RunScript().
Let presume that you created a function called "DispenseIceCream" and it now lives in a file called DispenseIceCream.m1s on your hard disk.
AND Can call it into use with a simple DoOemButton(444).
[DB]: NO. since you can not make a new magic #, you can't do DoOEMButton(NewMagicNumber).
(however, only a buggy whipper would want to... ...for those wondering, it's a running gag between Terry and I)
What you can do is run a named script. The call would look like:
RunScript(GetMainFolder() & "\TerrysMacros\" & "DispenseIceCream.m1s")
And Yes numbers make perfect sense to a CNC programmer everything we program in is numbers, Gcode,vars,parameters, gotos,subs,etc.
[DB]: Might be time to learn a new trick - or do you also stick to only metal alloys that were available in the era when gcode was defined...
(;-) TP