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

Home » Public Forums » archive » Bug? Hash and System Variable
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Bug? Hash and System Variable [message #84351] Thu, 30 May 2013 21:08 Go to previous message
SonicKenking is currently offline  SonicKenking
Messages: 51
Registered: October 2010
Member
The following simple code errors out

defsysv, '!SOME_SYS_VAR', hash()
help, !SOME_SYS_VAR
(!SOME_SYS_VAR)['A'] = 1
end

The output is as follows
<Expression> HASH <ID=1 NELEMENTS=0>
% Expression must be an array in this context: !SOME_SYS_VAR.

The funny thing is that I can actually run the same command by typing it on the IDL prompt. So following command runs:

IDL> (!SOME_SYS_VAR)['A'] = 1
IDL> print, !SOME_SYS_VAR
A: 1

Is it a bug or feature? And how can I correct the code so it can run inside a routine instead of on the prompt (@ is the same as typing on the prompt).

Thanks!
[Message index]
 
Read Message
Read Message
Previous Topic: IDLgrView question
Next Topic: Re: LinkedHash in IDL

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

Current Time: Wed Oct 08 17:04:09 PDT 2025

Total time taken to generate the page: 0.00439 seconds