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

Home » Public Forums » archive » array referencing problem ...
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: array referencing problem ... [message #43036 is a reply to message #42954] Wed, 09 March 2005 23:01 Go to previous messageGo to previous message
marc schellens[1] is currently offline  marc schellens[1]
Messages: 183
Registered: January 2000
Senior Member
> Here is an article that might help:
>
> http://www.dfanning.com/code_tips/tempvar.html

While this article is still covers the point, its a little bit
outdated:
IDL now correctly complains about the expression.

IDL> p = ptr_new( {a:1, b:2, s:{x:0,y:0, a:[256,256,48]} } )
IDL> ((*p).s.a)[2] = ((*p).s.a)[2] * 4
% Expression must be named variable in this context: <INT
Array[3]>.
% Execution halted at: $MAIN$


But there is still another bug in IDL:

function ret,a
return,a
end

IDL> a=1
IDL> ++(ret(a[0]))
IDL> print,a
1
But this only happens if used as a statement:

IDL> print,++(ret(a[0]))
% Expression must be named variable in this context: <INT (
1)>.
% Execution halted at: $MAIN$


Ah, and did I mention that GDL
(http://gnudatalanguage.sourceforge.net/)
behaves correctly in all cases :-)

Cheers,
marc
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: calling c from idl
Next Topic: Extract an image

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

Current Time: Wed Oct 08 18:09:29 PDT 2025

Total time taken to generate the page: 0.00252 seconds