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

Home » Public Forums » archive » Re: scalar system variable as single element array
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: scalar system variable as single element array [message #80165] Sun, 13 May 2012 23:31 Go to previous message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den söndagen den 13:e maj 2012 kl. 22:00:31 UTC+2 skrev fawltyl...@gmail.com:
> Hi guys,
>
> the IDL help says that a scalar can be considered a single element array. So why is the following expression failing?
>
> IDL> help, !pi[0]
> % Expression must be an array in this context: !PI.
> % Execution halted at: $MAIN$
>
> Is it a bug or feature :-)
>
> regards,
> Lajos

This works with variables but !pi is not a variable. Think of it as a constant, like the number 2:

IDL> a=!pi
IDL> help,2,!pi,a
<Expression> INT = 2
<Expression> FLOAT = 3.14159
A FLOAT = 3.14159
IDL> help,a[0]
<Expression> FLOAT = 3.14159
IDL> help,(2)[0],(!pi)[0]
<Expression> INT = 2
<Expression> FLOAT = 3.14159
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: cgplot and the disappearing white axis
Next Topic: Re: Cost of student version of IDL

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

Current Time: Wed Oct 08 18:56:36 PDT 2025

Total time taken to generate the page: 0.00407 seconds