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 
Return to the default flat view Create a new topic Submit Reply
Global variables and IDL [message #16744] Fri, 20 August 1999 00:00 Go to previous 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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
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: Fri Oct 10 09:28:05 PDT 2025

Total time taken to generate the page: 0.23880 seconds