Re: Widgets - 3.6 -> 4.0 Aaarrrggghhh!! [message #5905] |
Thu, 14 March 1996 00:00 |
landsman
Messages: 93 Registered: August 1991
|
Member |
|
|
In article <4i8842$bp2@atom.ansto.gov.au>, slx@anpnt22.anp.ansto.gov.au (Samantha Lane) writes...
> Hi again,
> its not so aaaarrrggghhh! as I first thought, but is there a command
> to determine what version of IDL is being run ?
>
The function SINCE_VERSION() below from the IDL Astronomy Library tests
whether the current version is later than a specified one. In your case,
it would be used as
if since_version('4.0.0') then ....
--Wayne Landsman landsman@stars.gsfc.nasa.gov
function since_version, release
;+
; NAME:
; SINCE_VERSION
;
; PURPOSE:
; Determine if the current release of IDL (as given in the
; !VERSION.RELEASE system variable) comes after the user specified
; release.
;
; CALLING SEQUENCE:
; test = SINCE_VERSION( release )
;
; INPUT:
; release - scalar string, must be formatted exactly like the
; !VERSION.RELEASE system variable (e.g. '3.0.0')
;
; OUTPUT:
; test - 1 if current release is identical or later than the specified
; 'release' else 0
;
; EXAMPLE:
; Use the /FTOXDR keyword to the BYTEORDER procedure if the current
; release of IDL is 2.2.2 or later
;
; IDL> if since_version('2.2.2') then byteorder, a, /FTOXDR
;
; REVISION HISTORY:
; Written Wayne Landsman Hughes/STX January, 1992
; Corrected algorithm W. Landsman April, 1992
;-
On_error,2
if N_params() EQ 0 then begin
print, 'Syntax - test = SINCE_VERSION( release )
return, -1
endif
release = strtrim( release, 2)
v1 = strmid( release, 0 ,1)
v2 = strmid( release, 2, 1)
v3 = strmid( release, 4, 1)
c1 = strmid( !VERSION.RELEASE, 0, 1)
c2 = strmid( !VERSION.RELEASE, 2, 1)
c3 = strmid( !VERSION.RELEASE, 4, 1)
if c1 EQ v1 then begin
if c2 EQ v2 then return, (c3 GE v3) else return, (c2 GT v2)
endif else return, (c1 GT v1)
end
|
|
|
|
Re: Widgets - 3.6 -> 4.0 Aaarrrggghhh!! [message #5907 is a reply to message #5905] |
Thu, 14 March 1996 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
slx@anpnt22.anp.ansto.gov.au (Samantha Lane) wrote:
>
> Hi again,
> its not so aaaarrrggghhh! as I first thought, but is there a command
> to determine what version of IDL is being run ?
>
Use the !VERSION IDL environment system variable.
If changing versions screws up your widgets considerably, then
you're probably using the xsize and ysize keywords too much.
It's often a better idea to let the "system" arrange things.
Obviously, if you have draw_widgets then you'll want to size
them. If the widgets look terrible in this default fitting,
then perhaps they could be rearranged.
I HATED 4.0's new widget placement scheme, but once you get
used to it it's much more powerful.
Dave Foster
UCSD Brain Image Analysis Lab
dfoster@bial1.ucsd.edu
|
|
|