comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Reading into arrays with order > 2
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Reading into arrays with order > 2 [message #17718] Mon, 08 November 1999 00:00 Go to previous message
Osamu Sasaki is currently offline  Osamu Sasaki
Messages: 2
Registered: November 1999
Junior Member
Steven Riley wrote:

> Assuming names3Mom is a 1D array of strings (of valid filenames) is there
> any reason why the following code will not read many files into a 3d array?
>
> FOR I=0,1 DO BEGIN
> close,1 & openr,1,names3Mom(I)
> readf,1,all3MomData(I,*,*)
> END
>
> I get no error messages, but when I look at my array it contains no data...?
> I'm quite sure the files being read contain data. Is this some inherent
> problem with readf and arrays with order > 2?

"Subscripted variable references are passed by value.
Parameters passed by value can only be inputs to program units."
(Source: IDL Online Help - Parameter Passing Mechanism)

The following code will work.

sz = SIZE(all3MomData)
buffer = ???ARR(sz(2), sz(3)) ; ??? is data type (INT, FLT etc.)

FOR I=0,1 DO BEGIN
close,1 & openr,1,names3Mom(I)
readf,1,buffer
all3MomData(I,*,*) = buffer
END


--------------------------------
May the Force be with you.
Osamu Sasaki as Dasaki
E-mail : dasaki@pc.highway.ne.jp
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: where() and IEEE NaN and other stuff...
Next Topic: Re: oplot problem - solved

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:53:09 PDT 2025

Total time taken to generate the page: 0.00437 seconds