On Sun, 24 Aug 2003 10:07:08 -0500, Alvaro Fernandez <alvaro@ATHENA-
ENG.COM> wrote:
>Perhaps the original poster wants arrays that can be resized
>dynamically, without having to know ahead of time how big they have to
>be? That's not what the original example showed, but maybe that's the
>ultimate intent. I note that there is a running index in the loop... and
>it's not that uncommon that you just don't know how big something should
>be until you've done some fairly complicated logic.
>
>In that case, reallocatable pointer arrays, like those in Numerical
>Recipes for Fortran 90, would do the trick. Is this what you're looking
>for, celevic?
Hi! Thank you for your answers!
Yes...basically my intention was to realize something that it is possible
to do in Matlab, where I don't need to know the dimensions of a matrix
(array) before filling it...for example (in matlab) I can decide to fill a
vector each time a certain condition is satisfied:
B, assigned vector of lenght n
A is not specified
j=1;
for i=1,n
while B(i) < threshold %(example of condition)
A(j)=j; % or = to a function of j or other
j=j+1
end
end
thank you, again.
cheers,
celevic
|