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

Home » Public Forums » archive » Strange behavior of function READ in a loop.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Strange behavior of function READ in a loop. [message #81542] Tue, 25 September 2012 10:10
Gerry Yu is currently offline  Gerry Yu
Messages: 1
Registered: September 2012
Junior Member
Hello everyone:
I got a strange output with the function READ in a loop.
A simplified example is as below:
_______________________
pro test
print, "This is the first line.", format="(A30/)"
for i=1,3 do begin
read, a ,PROMPT="input:"
print, i,": input is ",a
endfor
end
______________________________
The expected output should be something like:
______________________________
This is the first line.
input:1
1: input is 1.0000
input:2
2: input is 2.0000
input:3
3: input is 3.0000
____________________________
But what I get is (with IDL 7.1.1 on Win 7):
____________________________
input:1
This is the first line.
input:2

1: input is 1.00000
input:3
2: input is 2.00000
3: input is 3.00000
_________________________________
I am really confused by such a result.
Do someone know what happens here?

Thanks in advance~

yu
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Escaped Characters in string output
Next Topic: Re: Strange behavior of function READ in a loop.

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

Current Time: Wed Oct 08 18:35:17 PDT 2025

Total time taken to generate the page: 0.00357 seconds