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

Home » Public Forums » archive » Hey! Pssst! Wanna see something wierd?
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: Hey! Pssst! Wanna see something wierd? [message #8094 is a reply to message #8012] Mon, 03 February 1997 00:00 Go to previous message
Joseph M Zawodny is currently offline  Joseph M Zawodny
Messages: 24
Registered: March 1996
Junior Member
David Fanning wrote:
>
> Alright you IDL gurus. Explain this!
>
> number = STRING(10)
> FOR j=0, number DO PRINT, 'Cool...!'
>
> Weird, huh. IDL reads my mind! :-)
>
> David

Well since the loop variable of a FOR loop has the type of the
first parameter (namely whatever follows the equal sign) and all
other parameters (end-value and step-value) converted to the
same type, I am not surprised too much. The conversion of properly
formatted string variables to byte, integer, float, ... is well
known (look at READS function). I know this since I have had the
misfortune of expecting the following to work.

for k=0,123456789L do ...

for k=0,5,0.1 do ...

Neither of them worked as I expected until rewritten as

for k=0L,123456789 do ...

for k=0.,5,0.1 do ...

Have fun!

--

Work: Dr. Joseph M. Zawodny Play: Joe Zawodny
NASA Langley Research Center KO4LW@amsat.org
E-mail: J.M.Zawodny@LaRC.NASA.gov zawodny@exis.net
(757) 864-2681 (757) 864-2671 FAX http://wwwp.exis.net/~zawodny
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: KILL_NOTIFY Programs
Next Topic: writing color images - revisited

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

Current Time: Sat Oct 11 04:04:21 PDT 2025

Total time taken to generate the page: 0.63977 seconds