Re: [Gambas-user] analyzing version numbers in gambas

2009-03-26 Thread M0E.lnx
I get this when I run this code 1.1 1.1 1.16 1.2 1.2 1.3 1.35 1.4 1.5 1.6 Notice how it's listing "1.1" and "1.2" twice, this is because of the entries "1.1" and "1.10" These would in fact need to be different I guess there really is no easy way other than splitting each version string into an

Re: [Gambas-user] analyzing version numbers in gambas

2009-03-26 Thread Fabien Bodard
Dim arf As New Float[] Dim f As Float Dim s As String For Each s In Split("1.2,1.4,1.6,1.10,1.16,1.20,1.35,1.5,1.3,1.1") arf.add(s) Next arf.Sort For Each f In arf Print f Next Regards, Fabien Bodard --

Re: [Gambas-user] analyzing version numbers in gambas

2009-03-25 Thread Dimitris Anogiatis
Just brainstorming here, but if you add format the float in a 2 decimal string then replace "." with "" and reconvert the string to an integer you might be able to get the right kind of comparison results. like 2.05 and 2.10 would turn into 205 and 210 In which case using max would give you the la

Re: [Gambas-user] analyzing version numbers in gambas

2009-03-25 Thread Rob
On Wednesday 25 March 2009 13:54, M0E.lnx wrote: > I guess I would have thoutht there was something that could analize > something like "2.12" and "2.5" as floats and see which one is the > largest of the 2 Well, the problem with that is that 2.5 really is the larger of the two if you treat them

Re: [Gambas-user] analyzing version numbers in gambas

2009-03-25 Thread M0E.lnx
True... It's impossible to catch all of them. Not all developers stick to the standards.. I understand. FWIW, I've stated a class that takes the 2 strings and then splits them at the separator (".") After that it analizes each object in the array and determines which one of the two arguments is

Re: [Gambas-user] analyzing version numbers in gambas

2009-03-25 Thread Rob
On Wednesday 25 March 2009 13:19, M0E.lnx wrote: > I'm not dealing with my own version numbering here... I'm trying to > analize all versioning schemes if at all possible. It's not possible. 2.5 and 2.10 in the Gambas numbering scheme mean different things than 2.10 and 2.5 in some other develop

Re: [Gambas-user] analyzing version numbers in gambas

2009-03-25 Thread M0E.lnx
Yeah... and like I said, this works, but I'm not dealing with my own version numbering here... I'm trying to analize all versioning schemes if at all possible. I guess I could split the version string into an array and figure out manually from there... But I was kind of hoping not to do that. ;

Re: [Gambas-user] analyzing version numbers in gambas

2009-03-25 Thread M0E.lnx
The replace(".","") thing works, but it rus into problems with you get to something like 1.3b vs 1.3c Some developers have a different way of numbering their releases. -- ___ G

Re: [Gambas-user] analyzing version numbers in gambas

2009-03-25 Thread Jesus Guardon
Hi all This is the way I did it: First, I've setup an asynchronous httpclient. PUBLIC SUB _getVer_Finished() DIM myVersion, verUpdate AS Integer DIM sMyVer AS String = "1" & Replace(Application.Version, ".", "") ver = "1" & Replace(ver, ".", "") myVersion = CInt(sMyVer)

Re: [Gambas-user] analyzing version numbers in gambas

2009-03-25 Thread Rob
On Wednesday 25 March 2009 11:29, Ron wrote: > > I guess, in these cases, you can use the Val() function. > Do a replace to remove the . then 12 is less(older) then 135. That only works if all the versions are part of the same major release. 21 is less than 135 too... In Perl, I would do someth

Re: [Gambas-user] analyzing version numbers in gambas

2009-03-25 Thread Ron
Laurent Carlier schreef: > Le mercredi 25 mars 2009 16:07:11 M0E.lnx, vous avez écrit : >> I need a way to logically analize version numbers in gambas. >> >> For instance, I have a list of available versions of the same program, >> let's say the list is >> >> 1.2 >> 1.4 >> 1.6 >> 1.10 >> 1.16 >> 1.

Re: [Gambas-user] analyzing version numbers in gambas

2009-03-25 Thread Laurent Carlier
Le mercredi 25 mars 2009 16:07:11 M0E.lnx, vous avez écrit : > I need a way to logically analize version numbers in gambas. > > For instance, I have a list of available versions of the same program, > let's say the list is > > 1.2 > 1.4 > 1.6 > 1.10 > 1.16 > 1.20 > 1.35 > 1.5 > 1.3 > 1.1 > > These

[Gambas-user] analyzing version numbers in gambas

2009-03-25 Thread M0E.lnx
I need a way to logically analize version numbers in gambas. For instance, I have a list of available versions of the same program, let's say the list is 1.2 1.4 1.6 1.10 1.16 1.20 1.35 1.5 1.3 1.1 These are of course in no particular order. A human knows that out of all of these, version 1.35