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

Home » Public Forums » archive » Re: How to tell if I'm running IDL or PV-WAVE
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: How to tell if I'm running IDL or PV-WAVE [message #1772] Mon, 31 January 1994 07:19 Go to next message
thompson is currently offline  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 #1773 is a reply to message #1772] Mon, 31 January 1994 08:11 Go to previous messageGo to next message
knipp is currently offline  knipp
Messages: 68
Registered: January 1993
Member
In article 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.
>
> --
> Mark Rivers (312) 702-2279 (office)
> CARS (312) 702-9951 (secretary)
> Univ. of Chicago (312) 702-5454 (FAX)
> 5640 S. Ellis Ave.


Hi

Here's a small function returning 1 if called in IDL or 0 if not.
The basic idea is that !version.release in WAVE is 4 characters long, in
IDL 5.

Karl

____________________________________________________________ __________________
__ ____ __
/ // _ \ / / Karlheinz Knipp phone: +49 511 - 762 4922
/ // /_/ // / University of Hannover fax: +49 511 - 762 2483
/ // ____// / Institute for Photogrammetry
/ // / / / Nienburger Str.1
/_//_/ /_/ FRG 30167 Hannover 1 email: knipp@ipi.uni-hannover.de


;+
function is_idl

; function: is this IDL (or wave)
; ------------------------------------------------------------ ------------------
; START OF DESCRIPTION
;
; function IPI, U Hannover 04'93, modified 04'93
; 06'93: string-length !version.release
;
; METHOD: is this IDL (or wave)
; assumption: strlen(!version.release) = 5 (IDL)
; strlen(!version.release) = 4 (WAVE)
;
;
;
; INPUT PARAMETER: none
;
; RETURNS: 1 in case of idl [-1 in case of ERROR]
;
; INPUT KEYWORDS : none
;
; OUTPUT KEYWORDS : none
;
; EXAMPLE:
;
; print, is_idl()
;
; END OF DESCRIPTION
; ------------------------------------------------------------ ------------------
;-

ret_val = -1 ; return - value


; ------------------------------------------------------------ ------------------
; test input, no test


; ------------------------------------------------------------ ------------------
; return & end

return, strlen ( !version.release ) ne 4
end
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 Go to previous message
landers is currently offline  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 Go to previous message
offenbrg is currently offline  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 Go to previous message
sterne is currently offline  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 Go to previous message
ft is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: mixing PS fonts in PV-WAVE\
Next Topic: multiple selections from a list

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

Current Time: Wed Oct 08 11:54:03 PDT 2025

Total time taken to generate the page: 0.00812 seconds