Problem Statement:
Dynamic Tables are NOT working if using an array that does not start with
and index of 0 (zero) or uses non sequential integers in the index.
Example:
You would expect this code to produce a 1x2 table, with "hello," in row 1
and "world," in row2. However, row 2 does not print. If you modify @v[0]
to @v[1] a 0x0 or NULL table will be generated.
<html>
<body>
[- @v[0] = "hello,";
@v[2] = "world,";
-]
<table border=1>
<tr>
<td>[+ $v[$row] +]</td>
</tr>
</table>
<BR>
</body>
</html>
Comments:
I didn't find anything in the docs that stated arrays had to begin with
element zero and had to be sequentially numbered integers :) so it might be
a bug. I would expect the Dynamic Tables to be generated with a
"foreach $element in (@array)" as opposed to
for ($i=0; $i<@array; $i++)
{
# exit on first undefined array element and assume end
}
It is obvious now, but I spent hours going over my code trying to find the
error. It turns out that my assumptions on how the dynamic table generator
worked were in error. If this is the intended behavior please let me know
and I will adjust my code by converting all the arrays to sequentially
numbered integer indexes starting at zero.
Thanks!
Michael George III
[EMAIL PROTECTED]
http://mike.wnol.net
"Douglas Adams, we'll miss you and thanks for the answer to life, the
universe and everything!"
1952 - May 11, 2001
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]