[Gambas-user] Application.Version of another program
T Lee Davidson
t.lee.davidson at gmail.com
Thu Dec 9 21:28:56 CET 2021
On 12/9/21 11:33 AM, Admin wrote:
> Don't even remember how many times I bumped into wanting this feature while writing a programm in Gambas, so I decided to ask:
> Is it possible to create such feature, that can easily print another .gambas program version?
> Like
>
> if Application.Version("~/a.gambas") = "0.0.1" then print "pre-alpha"
>
> if Application.Version("~/a.gambas") > Application.Version then AutoUpdateSub
>
> Would be so much less pain to implement autoupdating software. Not that I don't have an established mechanism of doing so, but...
>
> Best regards,
> Dmitry
Consider submitting a feature request for that at the Gambas Bugtracker.
In the meantime, you could implement your own function as below:
Public Sub Main()
Dim rMatch As RegExp
rMatch = New RegExp(File.Load("a.gambas"), "Version=(.*)\n")
Print rMatch[1].Text
End
--
Lee
More information about the User
mailing list