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

Home » Public Forums » archive » Re: 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: null array [message #36544 is a reply to message #36471] Tue, 30 September 2003 12:36 Go to previous message
Stein Vidar Hagfors H[2] is currently offline  Stein Vidar Hagfors H[2]
Messages: 28
Registered: October 2002
Junior Member
Well, David, always pluggin' the pointers, eh?

Using pointers simply because of their ability to point to undefined
variables seems a bit overkill to me, though. A variable in itself
is just as good at representing an undefined variable... as in:

if n_elements(variable) eq 0 then print,"Variable undefined" $
else variable = [initValue]

And the way to "undefine" a variable is the good old

dummy = temporary(variable)

David Fanning <david@dfanning.com> writes:
> Tomson writes:
>
>> But What I want to do is to initialize several arrays which are in common
>> block and their length will be changed for different call and the lengths
>> of them may be zero. If the lengthes of them are zero, the process will be
>> changed. If there isnot any initialization, the array return to the main
>> program may be the former ones.
>
> If I understand you correctly, you may find a pointer
> useful in this situation. A pointer could point to
> a "null array", in the sense that it would point to
> an "undefined variable":
>
> ptr = Ptr_New(/Allocate_Heap)
> IF N_Elements(*ptr) EQ 0 THEN Print, 'Pointer undefined' ELSE $
> *ptr = [initValue]
>
> Cheers,
>
> David
>
> --
> David W. Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Phone: 970-221-0438, E-mail: david@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155

--
------------------------------------------------------------ --------------
Stein Vidar Hagfors Haugan
ESA SOHO SOC/European Space Agency Science Operations Coordinator for SOHO

NASA Goddard Space Flight Center, Tel.: 1-301-286-9028
Mail Code 682.3, Bld. 26, Room G-1, Cell: 1-240-354-6066
Greenbelt, Maryland 20771, USA. Fax: 1-301-286-0264
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to read the data like this?
Next Topic: Programming ENVI

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

Current Time: Sat Oct 11 09:46:20 PDT 2025

Total time taken to generate the page: 1.67588 seconds