--- In [email protected], "brucexs" <[EMAIL PROTECTED]> wrote:

>> If your 1d vector represents a 2d vector arranged by rows, with 
>> ncol columns, then you can access element i, j with v[j*ncol +i].   
>> You cannot use v[i,j] once the vector is declared as 1d as PowerPro 
>> needs to know the number of rows when the vector is declared.

> "rows" should be columns


Thanks Bruce. Your i and j seem to be reversed however.

Element i,j can be accessed with v[(i*ncol)+j]

i and j are zero-based, whereas ncol is the true number of columns.

If all the 2d vector needed at declaration was the number of columns,
it would be great. But the number of rows must also be be fixed at
declaration. It works when predefined with more rows than ultimately
needed, but not with less. It would be nice to have a 2d vector where
the number of columns was un-alterable, but the number of rows could
be grown. By the time the vector gets fully loaded (load it as if were
a 1d vector), the length would be divisible by the number of columns.

Regards,
Sheri

Reply via email to