09-28-2005 04:22 AM
09-28-2005 04:40 AM
Let me see if I have correctly understood your problem...
First generated number goes on control1, second on control2, third on control3, fourth on control5, fifth on control1 again and so on scannin controls one at a time.
In this hipothesis, a good approach can be:
1. Create an array of control handles:
int ctl[] = { PANEL_4_NUMERIC_2, PANEL_4_NUMERIC_3, PANEL_4_NUMERIC_4, PANEL_4_NUMERIC_5 }
2. Use a static variables inside timer callback to hold index in the array. Write new value on the i-th element of the array and reset index as appropriate:
static idx = 0;
a1 = (float)Random (-0.8, 0.8);
SetCtrlVal (panel4, ctl[idx], a1);
if (++idx > 3) idx = 0;
09-29-2005 05:35 AM
09-29-2005 06:42 AM