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

Home » Public Forums » archive » PRINTF printing to wrong LUN
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: PRINTF printing to wrong LUN [message #71757 is a reply to message #71666] Wed, 14 July 2010 10:53 Go to previous messageGo to previous message
jeanh is currently offline  jeanh
Messages: 79
Registered: November 2009
Member
On 14/07/2010 12:20 PM, polystethylene wrote:
>
>>
>>> Any one seen anything like this before?
>>
>> No. :-)
>>
>> I strongly suspect pilot error.
>>
>>
>
> It usually is :)
>
>
> I've just deleted the long winded response where I printed out every
> line in my code that involves either a OPENW,lun,/GET_LUN or a CLOSE
> statement...
>
> Because I realised that before the above snippet of code I have:
>
> OPENW,lun1,'flatB.list',/GET_LUN
> OPENW,lun2,'flatV.list',/GET_LUN
> OPENW,lun3,'flatR.list',/GET_LUN
> OPENW,lun4,'flatI.list',/GET_LUN
> OPENW,lun5,'bias.list',/GET_LUN
> OPENW,lun6,'dark.list',/GET_LUN
> OPENW,lun7,'light.list',/GET_LUN
> OPENW,lun8,'fblight.list',/GET_LUN
> OPENW,lun9,'blight.list',/GET_LUN
>
> PRINTF,lun1,FORMAT='(A0)',Bflatfilelist
> PRINTF,lun2,FORMAT='(A0)',Vflatfilelist
> PRINTF,lun3,FORMAT='(A0)',Rflatfilelist
> PRINTF,lun4,FORMAT='(A0)',Iflatfilelist
> PRINTF,lun5,FORMAT='(A0)',biasfilelist
> PRINTF,lun6,FORMAT='(A0)',darkfilelist
> PRINTF,lun7,FORMAT='(A0)',lightlist
> PRINTF,lun8,FORMAT='("fb",A0)',lightlist
> PRINTF,lun9,FORMAT='("b",A0)',lightlist
>
> CLOSE,/ALL
>
>
> Redinfo is opened before the close,/all statement...
>
>
> So I deduce from this that in the absence of a 'redinfo' to printf to,
> IDL has printed to another open lun...
>
> This is interesting behaviour, I would have expected a message telling
> me that the file unit 'redinfo' doesn't exist?
>
>
> Anyway, thanks everyone. Once again I air my ignorance and shoddy
> bookkeeping skills public on the idl usenet group. I learnt something
> though, which is always good :)

Hi,

well, the file unit is closed, but the variable is not erased.
So if by chance/bad luck, another lun has the same value as in redinfo,
your printf,redinfo statement will print to that file...

ex:
openU, redinfo, /get_lun
print, redinfo --> 5
free_lun, redinfo
print, redinfo --> 5

openU, aaa, /get_lun
print, aaa --> 5

then
printf, redinfo
and
printf, aaa

are the same, and will print in the same file

Jean
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: PRINTF printing to wrong LUN
Next Topic: Re: read XML with IDL

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

Current Time: Tue Dec 02 12:47:51 PST 2025

Total time taken to generate the page: 1.27952 seconds