Re: [Gambas-user] analyzing version numbers in gambas
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 -- ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] analyzing version numbers in gambas
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 would be the greater value. How can I make gambas analyze this? -- -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] analyzing version numbers in gambas
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 are of course in no particular order. A human knows that out of all of these, version 1.35 would be the greater value. How can I make gambas analyze this? I guess, in these cases, you can use the Val() function. http://64.128.110.55/help/lang/val Regards, -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] analyzing version numbers in gambas
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.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 would be the greater value. How can I make gambas analyze this? I guess, in these cases, you can use the Val() function. http://64.128.110.55/help/lang/val Regards, Do a replace to remove the . then 12 is less(older) then 135. Regards, Ron_2nd. -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] analyzing version numbers in gambas
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) IF ver THEN verUpdate = CInt(ver) IF verUpdate myVersion THEN IF Message.Question((There is a new version of yourProgram.\nDo you want to visit the download page?), (Yes), No) = 2 THEN RETURN Desktop.Open(http://yourProjectWebPage.com;) ENDIF END Regards Jesús M0E.lnx escribió: 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 would be the greater value. How can I make gambas analyze this? -- ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] analyzing version numbers in gambas
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. -- ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] analyzing version numbers in gambas
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. ;) -- ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] analyzing version numbers in gambas
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 as floats, but is the earlier version number in the numbering schemes that are currently in fashion. Rob -- ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] analyzing version numbers in gambas
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 latter as the larger of the two. In the case of 2.05a and 2.05c then you'd prolly have to see which string is the larger of the two. I'd use a simple IF a b then print b else print a kind of statement or the comp function to compare the 2 strings. Hope this helps Dimitris Wed, Mar 25, 2009 at 7:36 PM, Rob sourceforge-raind...@kudla.org wrote: 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 as floats, but is the earlier version number in the numbering schemes that are currently in fashion. Rob -- ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user