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

Home » Public Forums » archive » Re: Is there a standard 'null' 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: Is there a standard 'null' array? [message #34593 is a reply to message #34590] Mon, 31 March 2003 00:40 Go to previous messageGo to previous message
marc schellens[1] is currently offline  marc schellens[1]
Messages: 183
Registered: January 2000
Senior Member
> P.S. There was talk of adding a zero-length-array type a few years
> ago, but the consensus was that it's probably too late to fit it
> easily into a 25 year old program.

So what? If its now introduced, old code would not have to change.

I don't know Matt's actual need, but another simple method I
use for small arrays is just to set the first element and later
delete it. The code looks nicer than with this if n_elements()...
and for less than somthing 100 elements (and not deep inside some loops)
its fine (even quicker than with if n_elements() within the loop):

vec=0
for i=0,cowscomehome do begin
if some_test then do vec=[vec,complicated_function(i)]
endfor
if n_elements(vec) gt 1 then vec=[1:*] else tmp=temporary(vec)


cheers,
marc
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: positioning of IDLgrContour object
Next Topic: SEARCH2D VS REGION_GROWTH

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

Current Time: Wed Oct 08 19:31:38 PDT 2025

Total time taken to generate the page: 0.00454 seconds