[Gambas-user] check 4 Gambas Runtime files?

PICCORO McKAY Lenz mckaygerhard at gmail.com
Wed Dec 13 15:43:02 CET 2017


the suggestin from tobias are the best for check a specific version string,
due return a exact result, not an interpretative result

good, but only works if gambas are installed, if not return "commando not
found"



Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-12-13 9:21 GMT-04:00 Jussi Lahtinen <jussi.lahtinen at gmail.com>:

> gbx3 -V
> or
> gbx3 --version
>
> Works also...
>
>
> Jussi
>
> On Wed, Dec 13, 2017 at 9:54 AM, Tobias Boege <taboege at gmail.com> wrote:
>
>> On Tue, 12 Dec 2017, mikeB wrote:
>> > On my web site, that I offer software programmed using Gambas, I have a
>> > notice :
>> > ***********************************************************************
>> > VERY IMPORTANT: before installing this app you will need to install
>> Gambas
>> > Runtime  v10 files - most systems will not have these very new files
>> > installed yet.
>> >
>> > Do so via the terminal commands:
>> > sudo add-apt-repository ppa:gambas-team/gambas3
>> > sudo apt-get update
>> > ***********************************************************************
>> > Now that Gambas runtime 10 files are more common - being install by the
>> > Distro - is there a way for the user (terminal command) to check if
>> they are
>> > installed?
>> >
>> > This is a real newbie question I'm sure but hey.. I'm a newbie!
>> > Thanks for any all help on this matter and have a GREAT day,
>> > mikeB
>> >
>>
>> First check if the interpreter gbx3 is found in PATH, using the "which"
>> utility. If not, I wouldn't call Gambas properly installed (although
>> some people might disagree -- it's their computer -- but then they will
>> be able to figure their Gambas version out themselves).
>>
>> Once you have that, the System class has FullVersion which gives you the
>> Gambas version as a string and you can compare it like this:
>>
>>   $ gbx3 -e 'Comp(System.FullVersion, "3.10", gb.Natural) >= 0'
>>
>> Comp will return the sign (-1, 0 or 1) of subtracting the version 3.10
>> from your Gambas version. You want the comparison to yield 0 or 1.
>> With the above line, you will see either the string "True" or "False"
>> printed to the terminal; you can make the output fancier.
>>
>> NOTE: gb.Natural makes the comparison by natural sort, which is
>> appropriate
>> to compare version numbers. Observe:
>>
>>   $ gbx3 -e 'Comp("3.2", "3.10")'
>>   1
>>   $ gbx3 -e 'Comp("3.2", "3.10", gb.Natural)'
>>   -1
>>
>> Because "2" comes before "1" in the alphabet, the default lexicographic
>> comparison mode declares the string "3.2" to be greater than "3.10",
>> but gb.Natural gets it right.
>>
>> Also never coerce the string version into a float for easier comparison
>> because you'll run into nasty bugs caused by float roundoff.
>>
>> Regards,
>> Tobi
>>
>> --
>> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>>
>> --------------------------------------------------
>>
>> This is the Gambas Mailing List
>> https://lists.gambas-basic.org/listinfo/user
>>
>> Hosted by https://www.hostsharing.net
>>
>
>
>
> --------------------------------------------------
>
> This is the Gambas Mailing List
> https://lists.gambas-basic.org/listinfo/user
>
> Hosted by https://www.hostsharing.net
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20171213/89f4eb5c/attachment.html>


More information about the User mailing list