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

Home » Public Forums » archive » Variable attributes and undef vars
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: Variable attributes and undef vars [message #90236 is a reply to message #90235] Thu, 12 February 2015 15:17 Go to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Thursday, February 12, 2015 at 4:01:51 PM UTC-7, fawltyl...@gmail.com wrote:
> From the IDL docs: "All IDL variables have special attributes that return information about the variable. These attributes are equivalent to calling the N_ELEMENTS, SIZE, or TYPENAME functions."
>
> This does not work for undefined variables:
>
> IDL> help, n_elements(a)
> <Expression> LONG = 0
> IDL> help, a.length
> % Expression must be a structure in this context: A.
> % Execution halted at: $MAIN$
> IDL>
>
> Bug or feature? :-)
>
> regards,
> Lajos

Bug. I think I got worried that it would conflict with "static methods" and "static properties" on IDL classes, so by default it just throws an error. But it probably should just work. Especially because it also doesn't work on !null variables either:

IDL> a = []
IDL> a.length
% Expression must be a structure in this context: A.

I'll think about the right approach...

-Chris
[Message index]
 
Read Message
Read Message
Previous Topic: Linux-like touch command in IDL
Next Topic: IDL array subscripting issue

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

Current Time: Wed Oct 08 15:56:24 PDT 2025

Total time taken to generate the page: 0.00393 seconds