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

Home » Public Forums » archive » Re: something like perl's 'require 5.4'
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: something like perl's 'require 5.4' [message #24696 is a reply to message #24694] Tue, 17 April 2001 11:21 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Vapuser <vapuser@catspaw.jpl.nasa.gov> writes:
> How about:
>
> version=strupcase(strjoin(strsplit(!version.release,'[.-_]', /extract), ""))
> input_version=strupcase(strjoin(strsplit(desired_release,'[. -_]',/extract), ""))
> if version lt input_version then 'eeek'
>
> Clearly `desired_release' would have to be input as a string.
>
> Of couse, this method 'requires' IDL 5.3 (IIRC), to get the regular
> expression semantics of strsplit. The other question is will RSI use
> any separator in version designations besides these three?


Umm, I never thought I'd be saying this, but aren't these a bit
overengineered? I have found that in 95% of the cases the DOUBLE
compare will work, and in 4% of the cases the STRING compare will
work.

If you know which version number you are targetting, then clearly you
can fashion a !VERSION.RELEASE comparison that will do the job.

William, you were probably thinking of a writing general procedure to
handle this type of version enforcement. It's actually a good idea.
But I've found that an "IF !VERSION.RELEASE..." is compact enough to
go right into my code.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: OVERLAYING IMAGES
Next Topic: reading file into structure?

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

Current Time: Sat Oct 11 22:09:59 PDT 2025

Total time taken to generate the page: 1.11795 seconds