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 #71761 is a reply to message #71666] Wed, 14 July 2010 08:34 Go to previous message
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
On 7/14/10 10:48 AM, polystethylene wrote:
> Has anyone had any experience of IDL seemingly printing to the wrong
> logical unit number?
>
> I have this IF clause in my code:
>
> IF nwestframes GE 1 THEN BEGIN
> OPENW,lun2,'rotate.list'
> PRINTF,lun2,FORMAT='("'+string(calibprefix)+'",A0)',lightlist[b]
> CLOSE,lun2
> PRINTF,lun,'rotate @rotate.list @rotate.list 180'
> PRINT,'Pier flip occurs at frame
> '+string(FORMAT='(I0)',nwestframes+1)+'. 180deg rotation to be applied
> to all eastern sky images'
> PRINTF,redinfo,'Pier Flip @ frame =
> '+string(FORMAT='(A0)',nwestframes+1)
> ENDIF
>
> So as you can see I have a new file introduced within the IF clause,
> and two previously open units, lun& redinfo.
>
> Up until this point in the code, IDL was correctly printing to each
> lun, as I instructed it to. In this case however, it has printed 'Pier
> Flip @ frame 100' in the file associated with 'lun' instead of
> 'redinfo'. redinfo has other info successfully printed to it, so I
> have no idea why IDL suddenly messes up here.
>


Hi,

I adapted your snippet a bit (see below) and it seems to work fine on my
system { x86_64 darwin unix Mac OS X 7.1 Apr 21 2009 64 64}

My guess is that upstream of that code block the LUNs are getting swapped.

Cheers,
Ben

PRO testme

OPENW, lun, "lun.txt", /GET
OPENW, redinfo, "redinfo.txt", /GET
GET_LUN, lun2


nwestframes = 2

IF nwestframes GE 1 THEN BEGIN
PRINT, "lun2= " + STRTRIM(lun2,2)
PRINT, "lun= " + STRTRIM(lun,2)
PRINT, "redinfo= " + STRTRIM(redinfo,2)
OPENW,lun2,'lun2.txt'
PRINTF,lun2,"print to lun2"
CLOSE,lun2
PRINTF,lun,'print to lun'
PRINT,'print to command line'
PRINTF,redinfo,"print to redinfo"
ENDIF

FREE_LUN, lun
FREE_LUN, redinfo
FREE_LUN, lun2

END
[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: Fri Oct 10 12:04:31 PDT 2025

Total time taken to generate the page: 7.43833 seconds