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

Home » Public Forums » archive » Re: 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 #8010] Sat, 01 February 1997 00:00
Runar J|rgensen is currently offline  Runar J|rgensen
Messages: 6
Registered: December 1995
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

Guru stuff are way out of my league, but I'll never learn anything if
I don't stick my neck out sometimes. Right? :-)

Quote: "The result of an operation becomes the same type as the operand
with the greatest precedence or potential precision."
IDL's User guide (Ver. 4) pp: 4-3

The precedence list of the 8 atomic data types stacks "string" as the
type
with least precedence. So I guess, since 0 is an integer 'number' is
coverted
to an integer (two steps up on the list) and prints 11 'Cool...!'s.

"weird"? Mnjaaa...? but definitely hazardous

Runar

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -=-=-=-=-=-=-=-
Runar Jorgensen ||
University of Oslo || Phone: +47 2285 5664
Department of Physics || Telefax: +47 2285 5671
P.O.Box 1048 Blindern || email: runar.jorgensen@fys.uio.no
0313 Oslo; Norway ||
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -=-=-=-=-=-=-=-
[Message index]
 
Read Message
Previous Topic: New Internet Software Report 2/1/97
Next Topic: execute problem

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

Current Time: Wed Oct 08 19:55:38 PDT 2025

Total time taken to generate the page: 0.00373 seconds