Re: Undefined variables in structures [message #62421] |
Thu, 11 September 2008 01:03 |
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  |
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
|
|
|