Results 1 to 8 of 8

Thread: If variable version less than value

  1. #1

    Default If variable version less than value

    I have a variable that is valued with "9.10" and I issue the following
    IF: "IF VARIABLE version less than "9.5". Its result is false. I change
    the IF to: "IF VARIABLE version less than "9.50" and the result is true.
    Why?


    --
    Dee Witham
    Professional Data Services, Inc

  2. #2

    Default Re: If variable version less than value

    Even if I change "version less than" to just "less than" it still
    doesn't work the correctly.

    --
    Dee Witham
    Professional Data Services, Inc

  3. #3

    Default Re: If variable version less than value

    Dee,

    > I have a variable that is valued with "9.10" and I issue the following
    > IF: "IF VARIABLE version less than "9.5". Its result is false. I change
    > the IF to: "IF VARIABLE version less than "9.50" and the result is true.
    > Why?

    Obviously I'm not the SB expert here<g> but I think you're comparing
    strings, not numeric values. so a string length of 4, for "9.10", is
    always going to be greater than a length of 3, for "9.5", at least I
    think that's correct?!<g>

    By adding the trailing ZERO you force the lengths to match and then
    the alphanumerical comparison returns the value you expect.

    Or something like that!

    --
    Lee White

    RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
    RPM Review........: http://www.clarionmag.com/cmag/v11/v11n06rpm.html
    Report Faxing.....: http://www.cwaddons.com/products/afe/
    ---Enroll Today---: http://CWaddons.com

    Enhanced Reporting: http://www.cpcs-inc.com

  4. #4

    Default Re: If variable version less than value

    Lee - I would agree with that if the IF was checking string lengths but
    I assume the IF should be checking the values within the string not the
    lengths.

    Dee

    --
    Dee Witham
    Professional Data Services, Inc

  5. #5

    Default Re: If variable version less than value

    Peter - thanks that explained it.

    Dee

    --
    Dee Witham
    Professional Data Services, Inc

  6. #6

    Default Re: If variable version less than value

    See thread in this group from Nov. 7. "How to format [PRODUCTVER] for use
    with vucheck.exe".

    Peter

  7. #7

    Default Re: If variable version less than value

    Dee,

    > I have a variable that is valued with "9.10" and I issue the following
    > IF: "IF VARIABLE version less than "9.5". Its result is false. I change
    > the IF to: "IF VARIABLE version less than "9.50" and the result is true.
    > Why?

    "10" is > "5"

    If "9.10" Version Less Than "9.5" is FALSE

    "10" is < "50"

    If "9.10" Version Less Than "9.50" is TRUE

    Friedrich

  8. #8

    Default Re: If variable version less than value

    Hi Darrel,

    > I have a variable that is valued with "9.10" and I issue the following
    > IF: "IF VARIABLE version less than "9.5". Its result is false. I change
    > the IF to: "IF VARIABLE version less than "9.50" and the result is true.
    > Why?

    Each part of the version string is evaluated and compared to the other part.
    9=9, 5<10, 50>10.

    Best regards,

    --
    Arnór Baldvinsson - Icetips Alta LLC
    Port Angeles, Washington
    www.icetips.com - www.buildautomator.com - www.altawebworks.com

    Icetips product subscriptions at http://www.icetips.com/subscribe.php

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •