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

Home » Public Forums » archive » Re: OpenW units ...
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: OpenW units ... [message #40480] Tue, 10 August 2004 08:53
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Rafael Loos writes:

> Hi, is there a way to have different units for writting in a loop?
>
> Something like that (Trying to open 6 files):
>
> For num = 0, 5 DO BEGIN
> OpenW, num , FILEPATH , /Get_Lun
> ENDFOR
>
> That does not work ... but is there a way to do that?

Well, you are overwriting your variable "num" six
times. You have the files open, alright, you just
can't reach five of them. :-)

Try this:

fileunits = IntArr(6)
For j = 0, 5 DO BEGIN
OpenW, num , FILEPATH, /Get_Lun
fileunits[j] = num
ENDFOR

Now you can access your files via the fileunits array.

OpenR, fileunits[3], ....

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Previous Topic: OpenW units ...
Next Topic: IDLWAVE environment variables

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

Current Time: Sun Oct 12 07:31:10 PDT 2025

Total time taken to generate the page: 1.20404 seconds