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

Home » Public Forums » archive » Re: globalization of variables
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: globalization of variables [message #51204] Tue, 07 November 2006 07:26
taejon is currently offline  taejon
Messages: 8
Registered: November 2006
Junior Member
Thank you very much for your help,the program worked!!
I am going to read the article today in the evening

regards

sven




David Fanning wrote:
> Sven Ohmann writes:
>
>> in the code below I want to use the variable voxel_a0 globally.
>
> I forgot to mention this in my last post, but here is
> an article that you might want to read to improve your
> IDL programs even more
>
> http://www.dfanning.com/tips/namefiles.html
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: globalization of variables [message #51205 is a reply to message #51204] Tue, 07 November 2006 07:26 Go to previous message
taejon is currently offline  taejon
Messages: 8
Registered: November 2006
Junior Member
Thank you very much for your help, it worked!!!
I am going to read the article today in the evening

regards

sven




David Fanning wrote:
> Sven Ohmann writes:
>
>> in the code below I want to use the variable voxel_a0 globally.
>
> I forgot to mention this in my last post, but here is
> an article that you might want to read to improve your
> IDL programs even more
>
> http://www.dfanning.com/tips/namefiles.html
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: globalization of variables [message #51220 is a reply to message #51205] Mon, 06 November 2006 06:49 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Sven Ohmann writes:

> in the code below I want to use the variable voxel_a0 globally.

I forgot to mention this in my last post, but here is
an article that you might want to read to improve your
IDL programs even more

http://www.dfanning.com/tips/namefiles.html

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: globalization of variables [message #51221 is a reply to message #51220] Mon, 06 November 2006 06:45 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Sven Ohmann writes:

> in the code below I want to use the variable voxel_a0 globally. That
> means, when I try after compilation (successful) to run the program I
> got the message:
>
> variable is undefined : voxel_a0
>
> In principle I want that after starting the program after pressing the
> 'apply_button' (eventhandler=3Dapplydata_event) the variables should be
> stored globally in the structure pState, so that when proceeding the
> program in the subprogram efgalc1_computedim I want to use them again,
> and later on in other functions or subprograms as well. Any idea ?


The variable isn't created yet when you are storing it
in your state pointer. It is only created *after* the
program runs. So, when you create the state pointer you
have to put "dummy" data there to hold the place for the
real data to be stored there later.

I typically store something there that I would recognize
as "not filled yet". For integers this might be the
number -999, for example. For floating point numbers is might
be !Values.F_NAN. If you have a pointer field
that you don't *know* how to fill, or if what you are
going to fill it with will vary in size or type, then,
of course, you "hold the space" with a null pointer.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: error reading file question
Next Topic: Re: [OT] Re: IDL Segmentation Fault

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

Current Time: Wed Oct 08 15:09:49 PDT 2025

Total time taken to generate the page: 0.00516 seconds