Daz
Tested it getting strange results here is the button code
local inst = mc.mcGetInstance() --Captures current instance of Mach 4
--rc = mc.mcCntlMdiExecute(inst, "m720") This doesn't seem to work
rc = mc.mcScriptExecuteIfExists(inst, "m720", false) This works but in the messagebox I get no value printed from the getregister that's on a windows 10 64bit
if I run it on my laptop windows 7 32 the lua editor crashes get the message Lua editor stopped working
Here is the m720() code
function m720()
function WriteRegister(regname, regvalue)
local inst = mc.mcGetInstance()
local hreg = mc.mcRegGetHandle(inst, string.format("iRegs0/%s", regname))
mc.mcRegSetValueString(hreg, tostring(regvalue))
end
function GetRegister(regname)
local inst = mc.mcGetInstance()
local hreg = mc.mcRegGetHandle(inst, string.format("iRegs0/%s", regname))
return mc.mcRegGetValueString(hreg)
end
-- probe = GetRegister("X_Probe")
Mytext = "1"
WriteRegister("X_Probe",Mytext)
regval = GetRegister("X_Probe")
wx.wxMessageBox(regval)
-- wx.wxMessageBox(probe)
return true
end
if (mc.mcInEditor() == 1) then
m720()
end
make any sense ?
Thanks gary