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

Home » Public Forums » archive » User selectable lower array bound?
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: User selectable lower array bound? [message #26146 is a reply to message #25981] Wed, 08 August 2001 08:04 Go to previous messageGo to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Martin Schultz wrote:
>
> Marc Schellens <m_schellens@hotmail.com> writes:
>
>> Ahem:
>>
>> pro push,list,elem
>> if n_elements(list) eq 0 then list=[elem] else list=[list, elem]
>> end
>>
>> cheers,
>> marc
>
> Won't work if elem is an array ;-(

For rank-1 arrays, shur it will (Can lists, as defined by JD's Perl description be other
than rank-1?) I do it all the time. Except that I would do:

if n_elements(list) eq 0 then list=elem else list=[list, elem]

For 2-D arrays you would have to check for conformability in your own code but that's also
easy to do. 4 or 5-D arrays would be a problem because at some point IDL chucks a nervous
wobbly when you try to do stuff like:

list = [[[[list]]],[[[elem]]]]

or somesuch sort of thing (i.e. too many "[]"'s). I think Craig Markwardt posted something
about this once.

> And if elem is a structure you will soon need something like
> Relax_StructAssign...

Shur, but I thought the whole point of something like Marc's push procedure was to
eliminate all the nasty details from the user (be they 2-d array or structure details),
i.e. it doesn the conformability check or the relaxed structure assignment?

paulv

--
Paul van Delst A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP Drink deep, or taste not the Pierian spring;
Ph: (301)763-8000 x7274 There shallow draughts intoxicate the brain,
Fax:(301)763-8545 And drinking largely sobers us again.
Alexander Pope.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL virtual reality (was 3D Object IDL )
Next Topic: problem getting values from cw_bgroup normal base

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

Current Time: Wed Oct 08 16:50:16 PDT 2025

Total time taken to generate the page: 0.00439 seconds