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 #80166 is a reply to message #80165] Sun, 13 May 2012 23:23 Go to previous messageGo to previous message
Lajos Foldy is currently offline  Lajos Foldy
Messages: 176
Registered: December 2011
Senior Member
On Monday, May 14, 2012 1:58:52 AM UTC+2, alx wrote:

> Because, in IDL, as far as I know, scalar and array are two different
> things!

As I wrote scalars can be considered as single element array (in subscript expressions). From IDL help:

Notice that because a scalar can be considered a single element array, subscripting a scalar with -1 (indicating the last element of the array) is equivalent to subscripting the scalar with 0 (indicating the first element of the array). For example:

scalar = 3

PRINT, scalar, scalar[0], scalar[-1]

IDL prints:

3 3 3

You can even write scalar[0, 0:0, *, -1:-1:1]. Now replace scalar with !PI.

regards,
Lajos
[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: Fri Oct 10 10:34:21 PDT 2025

Total time taken to generate the page: 0.71632 seconds