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*
[email protected]
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 <[email protected]>

> 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
>
> ------------------------------------------------------------------------------
> 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
> [email protected]
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to