This is possible, but not as user friendly.
So lets take what code you had
function SetRegister(regname, val)
local inst = mc.mcGetInstance()
local hreg = mc.mcRegGetHandle(inst, string.format("iRegs0/%s", regname))
mc.mcRegSetValueString(hreg, val)
if (debug_scp == 1) then
mc.mcCntlSetLastError(inst, "regname = " .. regname .. "val = " .. val)
end
end
and change it too
local inst = mc.mcGetInstance()
function SetRegister(regname, val)
mc.mcProfileWriteString(inst,"VarReg", regname, val)
end
function GetRegister(regname)
local val = mc.mcProfileGetString(inst, "VarReg", regname, "defVal")
return val
end
-- unload script or appropiate place must have - mc.mcProfileDeleteSection(inst, "VarReg") - to stop mach4 from saving to ini file or they will become persistant.
and for the user
SetRegister("test","testVal")
local teststring = GetRegister("test")
wx.wxMessageBox(teststring)
Looks pretty user friendly to me...................
DazTheGas