Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1881 closed Bug (No Bug)

_VersionCompare

Reported by: hunt Owned by: Gary
Milestone: Component: Standard UDFs
Version: 3.3.6.1 Severity: None
Keywords: Cc:

Description

$Version1 = "1.9.1"

$Version2 = "1.10"
MsgBox(0,"",_VersionCompare($Version1, $Version2)) ==
returns 1 but must -1

$Version1 = "1.9.b"

$Version2 = "1.10"
MsgBox(0,"",_VersionCompare($Version1, $Version2)) ==
returns 1 but must -1

$Version1 = "1.9b"

$Version2 = "1.10"
MsgBox(0,"",_VersionCompare($Version1, $Version2)) ==
returns 1 but must -1

Attachments (0)

Change History (4)

comment:1 by mvg, 15 years ago

Documented (well kinda) Function limitation. (No bug)

  • All these compares are done in lexicographical mode.
  • Ergo: 1.9xxx > 1.1xxx and/or 9xxx > 1xxx.

DOC
Remarks
This will try to use a numerical comparison but fall back on a lexicographical comparison.
See @extended for details about which type was performed.

comment:2 by J-Paul Mesnage, 15 years ago

Resolution: No Bug
Status: newclosed

comment:3 by anonymous, 15 years ago

If UBound($aVersion1) <> UBound($aVersion2) Then will lexicographical comparison without numerical comparison but this is WRONG.

comment:4 by mvg, 15 years ago

No. Nothing wrong with that.

  • Its stated that it will try to do a numerical compare.

    This will try to use a numerical comparison but fall back on a lexicographical comparison.

If you like it to behave differently recode your local copy.
Or provide the function with (better matching) version strings that will be compared in numerical mode.

(case closed for me. Ergo: not commenting on it anymore. (try forum for additional feedback/talking on this))

Modify Ticket

Action
as closed The owner will remain Gary.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.