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

Home » Public Forums » archive » Global variables and IDL
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
Global variables and IDL [message #16744] Fri, 20 August 1999 00:00 Go to next message
Kristian Kjaer is currently offline  Kristian Kjaer
Messages: 58
Registered: June 1998
Member
A while back, (13 Apr 1999 00:00:00 GMT, but I only read it now)
David Fanning wrote: << Subject: Re: Global variables and IDL

<< So I might write a "preferences" file for the application
<< that each person who installs the application has to modify
<< for their site. One item might be the location of the
<< "data directory". On the PC, this might look like this:
<<
<< DEFSYSV, '!Data_Directory', 'E:\secret\data'
<<
<< The UNIX user would modify this line to this:
<<
<< DEFSYSV, '!Data_Directory', '/usr/people/bob/secret/data'

(For what it's worth:)
For this kind of static information (where are the data, how to
print, etc.) I wrote a function, platform.pro which is called
whenever a module needs the information:

host=platform()

Platform.pro creates (internally) a number of structures similar to

dos_online_prfile32={ $
online : 'TRUE' ,$
dataroot : 'p:\bw1\tascom\dat' ,$
localdataroot :'d:\bw1\tascom\dat' ,$
plotfile : 'd:\temp\plot.ps' ,$
plotcmd : 'start PRFILE32.exe /q d:\temp\plot.ps' ,$
retain : 1 $ ; used in window,retain=host.retain
}
linux_offline_lpr={... etc

By a call

getenv('IDL_PLATFORM') ; IDL_PLATFORM: Environment var. telling us
where we are running

platform.pro decides which structure to return.
Then, if the code has to run on a new machine, platform.pro
needs adding to, but when, as happens more often in this case,
updated code is ported to any 'old' machine, no local changes
are needed.

Kristian
Re: Global variables [message #18848 is a reply to message #16744] Tue, 08 February 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
R.Bauer (R.Bauer@fz-juelich.de) writes:

> And don't use .reset_session!

Now, Reimer, you're not trying to have your cake and
eat it too, are you? :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Global variables [message #18849 is a reply to message #16744] Tue, 08 February 2000 00:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
David Fanning wrote:
>
> Erik Hummel (erik.hummel@philips.com) writes:
>
>> On a PC with Windows NT and object programming I like to use global
>> constants. I
>> like to define for instance some integer constant without the use of
>> common
>> blocks (the common block always has to be repeated before the variables
>> can be used)
>> or system variable.
>> Is it possible to declare a global constant without the use of common
>> blocks?
>
> Try DEFSYSV.
>
> Cheers,
>
>

And don't use .reset_session!
  • Attachment: R.Bauer.vcf
    (Size: 0.00KB, Downloaded 93 times)
Re: Global variables [message #18852 is a reply to message #16744] Tue, 08 February 2000 00:00 Go to previous message
Erik Hummel is currently offline  Erik Hummel
Messages: 6
Registered: February 2000
Junior Member
Thanks!

David Fanning wrote:

> Erik Hummel (erik.hummel@philips.com) writes:
>
>> On a PC with Windows NT and object programming I like to use global
>> constants. I
>> like to define for instance some integer constant without the use of
>> common
>> blocks (the common block always has to be repeated before the variables
>> can be used)
>> or system variable.
>> Is it possible to declare a global constant without the use of common
>> blocks?
>
> Try DEFSYSV.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting
> Phone: 970-221-0438 E-Mail: davidf@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155

--

-------------------------------------------------
Erik Hummel dr. E. Hummel
MR Image Handling Software

email: erik.hummel@best.ms.philips.com
Phone: +31 40 2763318
Fax: +31 40 2765644

Philips Medical Systems
Building QR1117, Veenpluis 6, 5684 PC Best
The Netherlands
===================================================
Re: Global variables [message #18855 is a reply to message #16744] Tue, 08 February 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Erik Hummel (erik.hummel@philips.com) writes:

> On a PC with Windows NT and object programming I like to use global
> constants. I
> like to define for instance some integer constant without the use of
> common
> blocks (the common block always has to be repeated before the variables
> can be used)
> or system variable.
> Is it possible to declare a global constant without the use of common
> blocks?

Try DEFSYSV.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Fonts in Z-device
Next Topic: Re: IDL 5.3 on NT newbie annoyances

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

Current Time: Thu Dec 04 07:25:35 PST 2025

Total time taken to generate the page: 1.44059 seconds