Strange behavior of function READ in a loop. [message #81542] |
Tue, 25 September 2012 10:10 |
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
|
|
|