There is an bug when you pass an array of struct as a parameter. The data becomes garbled with a call by a parameter, but not when you set the values inline. The following code illustrates the problem. The correct output is: 0, 10, 100 -> 1, 11, 101 -> 2, 12, 102 which it displays using the inline method. When I fill the array of structs with a call the output is garbled.
BTW, is there a better place to report bugs?
Gordon
 |  |  |
 | Code: typedef struct { int low; int med; int high; } datum;
typedef datum data[3];
void load_data (data &input) { int i;
for (i = 0; i < 3; i++) { input[i].low = i; input[i].med = i + 10; input[i].high = i + 100; } }
task main() { int i; data my_data;
// Load array of structs without call for (i = 0; i < 3; i++) { my_data[i].low = i; my_data[i].med = i + 10; my_data[i].high = i + 100; } eraseDisplay(); for (i = 0; i < 3; i++) { nxtDisplayTextLine(0, "%d", my_data[i].low); nxtDisplayTextLine(1, "%d", my_data[i].med); nxtDisplayTextLine(2, "%d", my_data[i].high); wait10Msec(200); }
// Set all data to known value for (i = 0; i < 3; i++) { my_data[i].low = 999; my_data[i].med = 999; my_data[i].high = 999; }
// Load array of structs with call load_data(my_data); eraseDisplay(); for (i = 0; i < 3; i++) { nxtDisplayTextLine(0, "%d", my_data[i].low); nxtDisplayTextLine(1, "%d", my_data[i].med); nxtDisplayTextLine(2, "%d", my_data[i].high); wait10Msec(200); } }
|  |
 |  |  |