I want to print out a structure member from an array and RabbitWeb gives me a "ZHMTL ERROR: Unknown variable error. The variables are declared globally and registered via the #web command.
Code:
struct meas1_type {
char year;
char mon;
char mday;
char hour;
char min;
char sec;
char rh;
char temp;
} meas1 [MEAS1_SIZE];
#web meas1;
int idx1 = 0;
#web idx1;
Here is applicable portion of the RabbitWeb script:
Code:
idx = <?z print($idx1) ?> << OK
<table border="1">
<tr><th>Idx</th><th>Time</th><th>Temp</th><th>Jumid</th></tr>
<tr><td><?z print($A) ?></td> << OK
<td><?z print($meas1[0].hour) ?>:
<?z print($meas1[$idx1].min) ?>: << Error
<?z print($meas1[$idx1].sec) ?></td> << Error
The "print($idx1)" and the "print($meas1[0].hour" execute correctly. The two "$meas1[$idx1].xxxx" outputs have the errors. I have used "$meas1[$A].xxxx" in the past with a loop with no problems.
Why is RabbitWeb throwing an error for $meas1[$idx1].xxxx"?