PlanetSquires Forums

Support Forums => General Board => Topic started by: Sean Scott on February 14, 2010, 12:13:41 PM

Title: displaying version info with code
Post by: Sean Scott on February 14, 2010, 12:13:41 PM
I maintain the version and copyright info in Project Properties. Is there a way to access that data from code? I would like to include the version and copyright info on an About form, but would like to pull it from project properties so I don't have to maintain it in two places.
Title: Re: displaying version info with code
Post by: Paul Squires on February 14, 2010, 12:21:05 PM
Check out the Help file under "Special Functions". You can reference the built-in App variable.


' Common info that the programmer can access via the global APP variable.

Type APP_TYPE
  Comments        As Asciiz * %MAX_PATH   ' Comments
  CompanyName     As Asciiz * %MAX_PATH   ' Company Name
  EXEName         As Asciiz * %MAX_PATH   ' EXE name of program
  FileDescription As Asciiz * %MAX_PATH   ' File Description
  hInstance       As Long                 ' Instance handle of the program
  Path            As Asciiz * %MAX_PATH   ' Current Path to the EXE
  ProductName     As Asciiz * %MAX_PATH   ' Product Name
  LegalCopyright  As Asciiz * %MAX_PATH   ' Legal Copyright
  LegalTrademarks As Asciiz * %MAX_PATH   ' Legal Trademarks
  ProductMajor    As Long                 ' Product Major number   
  ProductMinor    As Long                 ' Product Minor number   
  ProductRevision As Long                 ' Product Revision number
  ProductBuild    As Long                 ' Product Build number   
  FileMajor       As Long                 ' File Major number     
  FileMinor       As Long                 ' File Minor number     
  FileRevision    As Long                 ' File Revision number
  FileBuild       As Long                 ' File Build number     
  ReturnValue     As Long                 ' User value returned from FF_FormClose
End Type

Global App As APP_TYPE


Title: Re: displaying version info with code
Post by: Rolf Brandt on February 14, 2010, 02:37:51 PM
Hello Sean,

attached is a small example with an About box that uses version and copyright info from the file.

BTW,
the box can be used as Splash screen and as About box.
Title: Re: displaying version info with code
Post by: Sean Scott on February 14, 2010, 03:45:14 PM
Thanks for your help.