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 #24687 is a reply to message #24686] Tue, 17 April 2001 14:17 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
JD Smith <jdsmith@astro.cornell.edu> writes:
>> 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.
>
> *cough*
>
> <REITERATE>
>
> IDL> print, double('5.4.1') gt 5.4
> 0
>
> </REITERATE>
>
>
> So I guess what you really you mean that in 95% of cases you don't care
> about the (possible) last digit on the version number. This is fine,
> just say so. Here's a good example of when that last digit matters,
> from the "What's New in IDL 5.2.1":

Right, so use the string compare in this case. I'm easy. Since you
*know* what version you need, you can code a test that will work in
that case.

IDL> print, '5.2' LT '5.2.1' -> 1
IDL> print, '5.2.1' LT '5.2.1' -> 0
IDL> print, '5.3' LT '5.2.1' -> 0

if !version.release LT '5.2.1' then $
message, 'ERROR: sorry, no histograms for you!'

This approach will have a problem when IDL version 10 comes around
though. :-)

The overengineering part was my gentle chide for using features and
complexity that are more likely to get one into trouble that they are
to solve the problem at hand.

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: Mon Dec 01 01:49:06 PST 2025

Total time taken to generate the page: 0.88573 seconds