Re: How to tell if I'm running IDL or PV-WAVE [message #1772] |
Mon, 31 January 1994 07:19  |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
ft@maxwell.ccs.att.com (Frederick True) writes:
> In article <1994Jan28.034743.14539@bnlux1.bnl.gov> rivers@bnlux1.bnl.gov (mark rivers) writes:
>> Is there a way to find out from within a procedure whether one is running
>> PV-WAVE or IDL? I need to call LINKNLOAD if I am running PV-WAVE or
>> CALL_EXTERNAL if I am running IDL. The !version system variable doesn't
>> seem to have this information.
> Interesting point. There seems to be no system variable which tells you
> "Wave" or "IDL", or even the vendor name ("RSI" or "VNI"). Without doing
> some hack like trying to find a system variable which is only found in one
> of these packages, I'd use something along the lines of:
> wver = call_unix("printenv","WAVE_VERSION")
> Then, test wver for a null value (= running IDL) or a string value (= running
> Wave). I've never used IDL, so I can't assure you this will work there (it
> works in Wave). Nor am I sure what the analog would be in VMS; I assume
> "call_unix" is not part of the VMS version - but there must be some
> mechanism for performing an OS command.
This wouldn't work in IDL. The equivalent statement would be
wver = getenv("WAVE_VERSION")
which would work in either Unix or VMS.
Bill Thompson
|
|
|
|
Re: How to tell if I'm running IDL or PV-WAVE [message #1775 is a reply to message #1772] |
Mon, 31 January 1994 15:21  |
landers
Messages: 45 Registered: May 1993
|
Member |
|
|
In article <2ij9uj$jfd@skates.gsfc.nasa.gov>, offenbrg@trifle.gsfc.nasa.gov (Joel Offenberg) writes:
|> sterne@dublin.llnl.gov (Philip Sterne) writes:
|>
<....>
|>
|> The simplest way I can come up with is to check the on-line help.
|> ?call_external
|> should give you a littany about the call_external function in IDL and not much
|> of anything in PV-WAVE, and
|> ?linknload
|> should do the reverse. (If you have both IDL and PV-WAVE running on the same
|> system, you might get both sets of help, although I don't think so.)
|>
Actually, in the most current version of PV-WAVE CL/Advantage (4.20), the ? is no
longer a help command. It now responds with:
% To get online help, use the HELP command.
HELP calls up really fantastic new on-line docs (and for the near future, will
also do what HELP used to do).
INFO is the new command to do what HELP used to.
A bit of a pain, at first, but the new command names make a bit more sense to me.
Back to the issue at hand,
Bill Thompson's suggestion of using
GETENV('WAVE_VERSION')
is pretty good, except that WAVE_VERSION is not strictly required
(it's set in wvsetup, but some goofy sys.admin could whack it).
I think all of the WAVE environment variables are optional, strictly speaking.
How about looking for some standard file that's included with one but
not the other, like:
is_wave = FINDFILE(!Dir+'/bin/wave') NE ''
Of course, you gotta dink with it for VMS....
|
|
|
Re: How to tell if I'm running IDL or PV-WAVE [message #1777 is a reply to message #1772] |
Mon, 31 January 1994 08:00  |
offenbrg
Messages: 31 Registered: August 1993
|
Member |
|
|
sterne@dublin.llnl.gov (Philip Sterne) writes:
>>>> >> "mark" == mark rivers <rivers@bnlux1.bnl.gov> writes:
> mark> Is there a way to find out from within a procedure whether one is
> mark> running PV-WAVE or IDL? I need to call LINKNLOAD if I am running
> mark> PV-WAVE or CALL_EXTERNAL if I am running IDL. The !version system
> mark> variable doesn't seem to have this information.
> How about looking at the variable !PROMPT ?
> In Wave, it is "WAVE> ", and in IDL I think it is "IDL> ". This
> variable can be overridden by the user, but as long as you stick with
> the defaults, this would appear to be a way of telling them apart.
In IDL, and I think PV-WAVE as well, you can set the prompt to be whatever
you want. I can set my !PROMPT to be "WAVE> " just as easily as I could set
it to "IDL> ".
The simplest way I can come up with is to check the on-line help.
?call_external
should give you a littany about the call_external function in IDL and not much
of anything in PV-WAVE, and
?linknload
should do the reverse. (If you have both IDL and PV-WAVE running on the same
system, you might get both sets of help, although I don't think so.)
Joel
--
"...And I am unanimous in this" - Mrs. Slocumb
------------------------------------------------------------ ----------
| Joel D Offenberg | offenbrg@fondue.gsfc.nasa.gov |
| Hughes STX/ UIT Science Team | I get paid to stare into space. |
|
|
|
Re: How to tell if I'm running IDL or PV-WAVE [message #1778 is a reply to message #1772] |
Sun, 30 January 1994 17:36  |
sterne
Messages: 15 Registered: March 1992
|
Junior Member |
|
|
>>>> > "mark" == mark rivers <rivers@bnlux1.bnl.gov> writes:
mark> Is there a way to find out from within a procedure whether one is
mark> running PV-WAVE or IDL? I need to call LINKNLOAD if I am running
mark> PV-WAVE or CALL_EXTERNAL if I am running IDL. The !version system
mark> variable doesn't seem to have this information.
How about looking at the variable !PROMPT ?
In Wave, it is "WAVE> ", and in IDL I think it is "IDL> ". This
variable can be overridden by the user, but as long as you stick with
the defaults, this would appear to be a way of telling them apart.
Phil
--
------------------------------------------------------------ ---------
Philip Sterne | sterne@dublin.llnl.gov
Lawrence Livermore National Laboratory | Phone (510) 422-2510
Livermore, CA 94550 | Fax (510) 422-7300
|
|
|
Re: How to tell if I'm running IDL or PV-WAVE [message #1781 is a reply to message #1778] |
Sat, 29 January 1994 14:24  |
ft
Messages: 4 Registered: May 1993
|
Junior Member |
|
|
In article <1994Jan28.034743.14539@bnlux1.bnl.gov> rivers@bnlux1.bnl.gov (mark rivers) writes:
> Is there a way to find out from within a procedure whether one is running
> PV-WAVE or IDL? I need to call LINKNLOAD if I am running PV-WAVE or
> CALL_EXTERNAL if I am running IDL. The !version system variable doesn't
> seem to have this information.
Interesting point. There seems to be no system variable which tells you
"Wave" or "IDL", or even the vendor name ("RSI" or "VNI"). Without doing
some hack like trying to find a system variable which is only found in one
of these packages, I'd use something along the lines of:
wver = call_unix("printenv","WAVE_VERSION")
Then, test wver for a null value (= running IDL) or a string value (= running
Wave). I've never used IDL, so I can't assure you this will work there (it
works in Wave). Nor am I sure what the analog would be in VMS; I assume
"call_unix" is not part of the VMS version - but there must be some
mechanism for performing an OS command.
Regards,
--
Fred True "My name is Ozymandias, King of Kings:
AT&T Global Systems Technology Group Look on my works, ye Mighty,
ft@maxwell.att.com and despair!"
ftrue@attmail.com -P. B. Shelley
|
|
|