09-22-2010 03:34 PM
When I execute my code that contains SetCtrlVal, I get the following error:
“Invalid argument type found double expected int.” The variable in question is declared double, and from reading the help info, the variable should adapt to the declared type.
Solved! Go to Solution.
09-22-2010 03:52 PM
The data type in your program needs to match the data type of the control.
Go to the UI editor and double click on the control in question. Check the Data Type field displayed there. It needs to match what's in your program.
09-22-2010 04:00 PM
A typical reason for this error is using a wrong panel handle in SetCtrlVal: check that the handle passed to the function effectively is the one returned from LoadPanel or NewPanel function.
Another common issue it trying to address a control on a tab page using the handle of the panel that holds the tab control: you must consider that each tab page has its own panel handle as it were a separate panel; you can retrieve the handle associated with tab pages with GetPanelhandleFromTabPage () command.
09-22-2010 04:00 PM
I have checked that again, and the numeric control is declared as double.
09-22-2010 04:08 PM
Then either your panel handle is wrong, as Roberto suggested, or your control constant is wrong. Make sure that you're using a control constant by name, e.g. MAINPANEL_NUMERIC, and not a literal number, e.g. 2.
Also make sure that your have the order of the parameters correct. For example:
SetCtrlVal (panelHandle, PANEL_CONTROL_ID, value2set);
If you could post your code, this should be a quick fix.
09-22-2010 04:15 PM
Using GetPanelHandleFromTabPage did the trick! thanks alot.