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

Home » Public Forums » archive » Re: Undefined variables in structures
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Undefined variables in structures [message #62421] Thu, 11 September 2008 01:03
Joost Aan de Brugh is currently offline  Joost Aan de Brugh
Messages: 16
Registered: July 2008
Junior Member
Hi Mike,

>
>    const.color_filename = ptr_new(/allocate_heap)
>
> This will make *const.color_filename an undefined variable.
>

Thanks. This removes the slightly messy first-define-then-destroy-with-
Temporary construction.

Regards,
Joost
Re: Undefined variables in structures [message #62424 is a reply to message #62421] Wed, 10 September 2008 21:45 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
Joost Aan de Brugh wrote:
> 5 ; The way I now just thought of.
> Make it a pointer and during startup
> if *const.COLOR_FILENAME eq "" then void =
> Temporary(*consts.COLOR_FILENAME)
> and then simply
> plot,...,color=fsc_color(color,filename=*consts.COLOR_FILENA ME)
> ; This does work. I can dereference the pointer, because it is a valid
> pointer to an undefined heap variable. It is still a little bit

Yes, this is the way I would do it. It may also be useful in this type
of situation to initialize const.color_filename using the ALLOCATE_HEAP
keyword:

const.color_filename = ptr_new(/allocate_heap)

This will make *const.color_filename an undefined variable.

Mike
--
www.michaelgalloy.com
Tech-X Corporation
Software Developer II
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL -> C : How to save data from IDL?
Next Topic: Some questions about "axis"

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

Current Time: Sat Oct 11 03:37:52 PDT 2025

Total time taken to generate the page: 0.87922 seconds