[Gambas-user] getting Gambas version info across devices

Bruce Steers bsteers4 at gmail.com
Fri Mar 26 12:36:57 CET 2021


>>

> >> This should work for gambas binary files like gbc3 or gba3
>> >>    Dim project As Integer = InStr(sfile, "/gambas" & System.version &
>> >> "-" & System.Version, 1, gb.Binary)
>> >>    Dim length As Integer = InStr(sFile, "/", Project + 1, gb.binary) -
>> >> project
>> >>    Print Mid(sFile, Project + 1, length - 1)
>> >>
>> >> output would look like this
>> >>
>> >> gambas3-3.15.90+git202103222309.dd1a35456+build14e27c76f~ubuntu20.04.1
>> >>
>> >> "Failure is the key to success;
>> >>   each mistake teaches us something"  .. Morihei Ueshiba
>> >> Brian G
>> >>
>> >
>> > You should better run "gba3 -x .startup" to get the
>> > project startup configuration file contents and get the version from it.
>> >
>> > This is far more reliable!
>> >
>> > Regards,
>> >
>>
>> Yes, well, loading a binary file into a string is pretty well going to
>> have interesting side effects but in any case the the suggested approach
>> for the ELF files doesn't work.
>>
>> For example, I have searched both gbc3 and gbx3 here and the "tickler"
>> gambas3-3 does not occur in those files. I resume it is specific to
>> ubuntu.
>>
>> b
>>
>>
> Thanks Brian and Benoit.
>
> The trouble is i also want the trunk version info.
> seems only the binary files have it, the .gambas files like gbs3 only have
> maj.min.rel info
> Using your function on gbs3 Brian my output didn't look anything like
> yours it looked like this...
> *Version=3.15.90*
>

Sorry , that was the gbs3 output.
The binary method worked for one system Debian-sid and failed for all the
others :(
Thank you though :)
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210326/9ee108cb/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snap.png
Type: image/png
Size: 62076 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210326/9ee108cb/attachment-0001.png>


More information about the User mailing list