See if this example helps.
local inst = mc.mcGetInstance() -- Get the instance of Mach4
local xval = mc.mcProfileGetString(inst, "RememberPos", "X", "NotFound") -- Get the register Value
local yval = mc.mcProfileGetString(inst, "RememberPos", "Y", "NotFound") -- Get the register Value
local zval = mc.mcProfileGetString(inst, "RememberPos", "Z", "NotFound") -- Get the register Value
if(xval == "NotFound")then -- check to see if the register is found
wx.wxMessageBox('Register xval does not exist.\nYou must remember a postion before you can return to it.'); -- If the register does not exist tell us in a message box
elseif (yval == "NotFound")then -- check to see if the register is found
wx.wxMessageBox('Register yval does not exist.\nYou must remember a postion before you can return to it.'); -- If the register does not exist tell us in a message box
elseif (zval == "NotFound")then -- check to see if the register is found
wx.wxMessageBox('Register zval does not exist.\nYou must remember a postion before you can return to it.'); -- If the register does not exist tell us in a message box
else
mc.mcCntlMdiExecute(inst, "G00 G53 Z0.0000 \n G00 G53 X" .. xval .. "\n G00 G53 Y" .. yval .. "\n G00 G53 Z" .. zval)
end