--[[ This quicky debug function can be embedded into your Wizard or Macro for debugging your vars as to what there values are. The wxMessagebox is used since it is modal, and "stops" the program from continuing till you click the OK button. The wxMessageBox is the default behaviour, but you can add an optional "1" as a third parameter which will send it to Mach Error, which is NOT model. So, if you have this function in a series it will log to the error history box, but only the last error will show in the Mach error. Params: 1st Param is the Variables Name as a String, i.e. myvar would be "myvar". 2cd Param is the Variable itself, i.e. you would put myvar as param #2. 3rd Param is optional, and if used a 1, will send the data to Mach Err, if there is nothing for a 3rd param or other than 1 it will default to display in the wxMessageBox. NOTE: The wxMessageBox will sometimes appear BEHIND your Mach 4 window! Happy Debugging, Scott --]] function ShowVarVal(VariableNameAsString, VariableItSelf, DisplayChoiceAsNum) local mInst = 0; local inst = mc.mcGetInstance(mInst); local VariableName = ""; local VarValue = ""; VariableName = tostring(VariableNameAsString); VarValue = tostring(VariableItSelf); if DisplayChoiceAsNum ~= 1 then wx.wxMessageBox(VariableName .. " = " .. VarValue, "Value of Variable", wx.wxOK); else mc.mcCntlSetLastError(inst, VariableName .. " = " .. VarValue); end end function DebugVarValueTest() local StringVar = "Hello World";--1st variable we want to look at local NumberVar = 42;--2cd variable we want to look at (and the answer to the universe btw). --1st param is the variables name as a string --2cd is the varible itself --3rd optional a 1 displays in mach erro, nil or anything else is wxmessagebox ShowVarVal("StringVar", StringVar, 1);--displays to MachErr ShowVarVal("NumberVar", NumberVar);--displays to wxMessageBox local DummyDebugStopVar = 0;--debug stop/break point var DummyDebugStopVar = 1;--put break point here if doing F5 debugging. end if (mc.mcInEditor() == 1) then DebugVarValueTest(); end