[Gambas-user] App.Major Version

Fabien Bodard gambas.fr at ...626...
Fri Nov 8 15:23:41 CET 2013


My turn !!

Dim aVersion as String[] = scan(sVersion,"*.*.*")

Print aVersion[0]


Work also with split.

2013/11/8 Riaan Pretorius <pretorius.riaan at ...626...>:
> thx guys! exactly what i was looking for :)
>
> ------ Original Message ------
> From: "Alain Baudrez" <a.baudrez at ...626...>
> To: "mailing list for gambas users" <gambas-user at lists.sourceforge.net>
> Sent: 11/8/2013 3:11:37 PM
> Subject: Re: [Gambas-user] App.Major Version
>>2013/11/8 Bruce <bbruen at ...2308...>
>>
>>>  On Fri, 2013-11-08 at 10:37 +0100, Alain Baudrez wrote:
>>>  > Hoi,
>>>  >
>>>  > put those in a class
>>>  >
>>>  > ' Gambas class file : clsVerion
>>>  > ' Version Info
>>>  > '
>>>  > ' Call as follows:
>>>  > ' DIM cVersion as new clsVersion
>>>  > '
>>>  > ' Print cVersion.VersionMajor & "." & cVersion.VersionMinor & "
>>>Build #
>>>  " &
>>>  > cVersion.Build
>>>  > '
>>>  > Property Read Version ' Full version eg. 1.2.39
>>>  > Property Read VersionMajor As String ' Major part eg. 1
>>>  > Property Read VersionMinor As String ' Minor Part eg. 2
>>>  > Property Read VersionSmall As String ' Major and Minor eg. 1.2
>>>  > Property Read Build As String ' Revision eg. 39
>>>  >
>>>  > Private Versie As String
>>>  >
>>>  > Public Sub _new()
>>>  >
>>>  > Versie = Application.Version
>>>  >
>>>  > End
>>>  >
>>>  > Private Function Version_Read() As String
>>>  >
>>>  > Return Versie
>>>  >
>>>  > End
>>>  >
>>>  > Private Function VersionMajor_Read() As String
>>>  >
>>>  > Return Left(Versie, InStr(Versie, ".") - 1)
>>>  >
>>>  > End
>>>  >
>>>  > Private Function VersionMinor_Read() As String
>>>  >
>>>  > Return Mid(versie, InStr(Versie, ".") + 1, RInStr(Versie, ".") -
>>>  > InStr(Versie, ".") - 1)
>>>  >
>>>  > End
>>>  >
>>>  > Private Function Build_Read() As String
>>>  >
>>>  > Return Right(Versie, RInStr(Versie, ".") - 2)
>>>  >
>>>  > End
>>>  >
>>>  > Private Function VersionSmall_Read() As String
>>>  >
>>>  > Return Left(Versie, RInStr(Versie, ".") - 1)
>>>  >
>>>  > End
>>>  > ' ============= End of Class =============
>>>  >
>>>  >
>>>  >
>>>  >
>>>  > *Alain J. Baudrez*
>>>  > a.baudrez at ...626...
>>>  > Tel: +32(0)486485080
>>>  >
>>>  > *Personal Homepage:* http://baudrez.be
>>>  > http://facebook.com/abaudrez - http://twitter.com/abaudrez -
>>>  > http://about.me/abaudrez
>>>  > Webmaster cibliga.be - dierenartsrogiest.be
>>>  >
>>>  >
>>>  >
>>>  > 2013/11/8 Riaan Pretorius <pretorius.riaan at ...626...>
>>>  >
>>>  > > Good Day,
>>>  > >
>>>  > > I was wondering if the equivalent of App.Major (vb6) exists in
>>>Gambas?
>>>  > >
>>>  > > Example:
>>>  > >
>>>  > > ' Visual Basic 6.0
>>>  > >
>>>  > > Label1.Caption = "Version: " & App.Major & "." & App.Minor & "."
>>>_
>>>  > >
>>>  > > & App.Revision
>>>  > >
>>>  > >
>>>  > > Riaan
>>>  > >
>>>
>>>
>>>  Ow Alain, my poor fingers!
>>>
>>>  How about just
>>>
>>>          Application.Version.Split(".")[0] ' for the major
>>>          Application.Version.Split(".")[1] ' for the minor
>>>          Application.Version.Split(".")[2] ' for the revision
>>>
>>>  or for your OP's example
>>>
>>>          Label1.Caption = "Version: " & Application.Version
>>>
>>>  :-)
>>>
>>>  Bruce
>>
>>
>>Hey Bruce,
>>
>>I knew that somewhere someone with a much cleaner solution would pop
>>up.
>>Thanks for sharing.
>>
>>What about your poor fingers. Having programmed in COBOL, I find what I
>>did, not to heavy on my fingers, but your solution is much sleeker of
>>course ;)
>>
>>Alain
>>------------------------------------------------------------------------------
>>November Webinars for C, C++, Fortran Developers
>>Accelerate application performance with scalable programming models.
>>Explore
>>techniques for threading, error checking, porting, and tuning. Get the
>>most
>>from the latest Intel processors and coprocessors. See abstracts and
>>register
>>http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
>>_______________________________________________
>>Gambas-user mailing list
>>Gambas-user at lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
> ------------------------------------------------------------------------------
> November Webinars for C, C++, Fortran Developers
> Accelerate application performance with scalable programming models. Explore
> techniques for threading, error checking, porting, and tuning. Get the most
> from the latest Intel processors and coprocessors. See abstracts and register
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user



-- 
Fabien Bodard




More information about the User mailing list