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

Home » Public Forums » archive » Creating Variables in Programs
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: Creating Variables in Programs [message #12305 is a reply to message #12195] Tue, 14 July 1998 00:00 Go to previous message
R. Bauer is currently offline  R. Bauer
Messages: 137
Registered: November 1996
Senior Member
Craig Markwardt wrote:

> Martin Schultz <mgs@io.harvard.edu> writes:
>>
>> Perry Phillips wrote:
>>>
>>> Does anyone know of a way to create a new array under program control, ie
>>> create a string and use that string to make an array. As far as I can see
>>> this is impossible in IDL?
>>>
>>> --
>>> Perry Phillips p.phillips@mail.utexas.edu
>>
>>
>> here's a quick example
>>
>>
>> IDL> r=execute('a=fltarr(200)')
>> IDL> help,a
>> A FLOAT = Array[200]
>>
>
> There is a "gotcha." in the case of a compiled procedure, the
> variable "a" must have already been defined. The following is usually
> sufficient:
>
> A = 0
> ...
> R = EXECUTE('A=FLTARR(200)')
>
> The IDL internal compiler needs to know that "A" exists before it can
> be assigned to in an EXECUTE statement. The same applies for
> restoring variables: all the variables in the SAVE file must be
> predefined in the procedure. Assigning zero to them is fine.
>
>

I am not sure if this has changed with idl 5.1.An other way to get an undefined
variabel is b=n_elements(a)
Yes b is well defined by 0 but a is defined as undefined.

help
% At $MAIN$
B LONG = 0
A UNDEFINED = <Undefined>


Reimar

--
R.Bauer

Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Printing problems under Object Graphics ...
Next Topic: integer to float?

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

Current Time: Wed Oct 08 17:32:50 PDT 2025

Total time taken to generate the page: 0.00452 seconds