[Gambas-user] gb.gui.webview
T Lee Davidson
t.lee.davidson at gmail.com
Sun Apr 25 23:58:33 CEST 2021
On 4/25/21 4:54 PM, Tobias Boege wrote:
> This might be good enough but it's not "good" in absolute terms.
> The < operator doesn't recognize embedded versions and compare them
> correctly. While with recent versions
>
> "3.10.0" < "3.16.0" = True,
>
> you also have
>
> "3.2.0" < "3.16.0" = False, or
> "3.100.0" < "3.16.0" = True.
>
> In fact, when you compare strings, I don't think there is any implicit
> conversion or special treatment of numbers happening: try "010" < "1",
> which returns True.
>
> So, you didn't forget. It really doesn't work.
>
> Best,
> Tobias
Well shoot, Tobi. You blew that right out of the water, lol. I did very minimal testing. Thank you for the correction.
On 4/25/21 5:35 PM, Benoît Minisini wrote:
> If you want to convert versions, you must use:
>
> Comp(Version1, Version2, gb.Natural)
So then the comparison for this particular case would be:
If Comp(System.FullVersion, "3.16.0", gb.Natural) < 0 Then ...
--
Lee
More information about the User
mailing list