Array is empty after for loop [message #91482] |
Mon, 20 July 2015 02:25  |
Dete van Eeden
Messages: 32 Registered: July 2015
|
Member |
|
|
Hallo
I have an array profile=fltarr(500,6)
I read values into this array in a for loop
for k=0,5 do begin
for i=0,499 do begin
profile(i,k) = .....
endfor
endfor
while Im in the loop, there are values in the array profile but as soon as I exit the loop the whole array is empty?
How can this be?
|
|
|
|
Re: Array is empty after for loop [message #91499 is a reply to message #91482] |
Tue, 21 July 2015 07:56   |
Phillip Bitzer
Messages: 223 Registered: June 2006
|
Senior Member |
|
|
On Monday, July 20, 2015 at 4:25:38 AM UTC-5, Dete van Eeden wrote:
> Hallo
>
> I have an array profile=fltarr(500,6)
>
> I read values into this array in a for loop
>
> for k=0,5 do begin
> for i=0,499 do begin
> profile[i,k] = i*k ;square brackets for array indexing
> endfor
> endfor
>
> help, profile
>
> while Im in the loop, there are values in the array profile but as soon as I exit the loop the whole array is empty?
>
What do you mean the array is empty? Is it not defined? Full of zeros? Listlessly wandering through life?
I have modified your code slightly above. What is the result?
|
|
|
Re: Array is empty after for loop [message #91506 is a reply to message #91499] |
Wed, 22 July 2015 08:59  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
On 07/21/15 10:56, Phillip Bitzer wrote:
>
> What do you mean the array is empty? Is it not defined? Full of
> zeros? Listlessly wandering through life?
"Listlessly wandering through life?"
Ha ha ha!! (He says as he cleans up the coffee that came shooting out of
his nose!)
Gosh I needed that.
cheers,
paulv
|
|
|