04-03-2008 08:43 AM
04-03-2008 04:03 PM
There isn't a single command to obtain the value of multiple controls on a panel. Supposing that by "summary" you intend to assign each switch to a bit in final value, and since a bynary switch assumes only values 0 and 1 depending on its state, what you can do is the following:
int val[7]; // The array of switch values
int i;
int totalVal = 0;
GetCtrlVal (panelHandle, PANEL_SWITCH0, &val[0]);
GetCtrlVal (panelHandle, PANEL_SWITCH1, &val[1]);
GetCtrlVal (panelHandle, PANEL_SWITCH2, &val[2]);
GetCtrlVal (panelHandle, PANEL_SWITCH3, &val[3]);
GetCtrlVal (panelHandle, PANEL_SWITCH4, &val[4]);
GetCtrlVal (panelHandle, PANEL_SWITCH5, &val[5]);
GetCtrlVal (panelHandle, PANEL_SWITCH6, &val[6]);
GetCtrlVal (panelHandle, PANEL_SWITCH7, &val[7]);
for (i = 0; i < 7; i++) totalVal += (val[i] << i)