PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Peter House on May 31, 2010, 01:11:36 PM

Title: Accessing Project Properties from Code
Post by: Peter House on May 31, 2010, 01:11:36 PM
How do I access the Project Properties from my code?

In VB6 it was app.versionmajor or app.productname

Is this information easily available?

Title: Re: Accessing Project Properties from Code
Post by: Marc van Cauwenberghe on May 31, 2010, 01:23:22 PM
Hello Peter,

If you search for the word 'app' in the FF helpfile you will find:


Quote
APP Variable
In addition to the above special functions, FireFly allows you access to a special global TYPE variable that contains useful application specific information.
The TYPE is defined as follows:
' 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
Hope this helps.

Marc

Title: Re: Accessing Project Properties from Code
Post by: Rolf Brandt on May 31, 2010, 02:34:29 PM
In other words you can use it much like in VB6.
   
aVerInfo= "v. " & Format$(app.ProductMajor) & "." & Format$(app.ProductMinor) & _
          "." & Format$(app.ProductRevision) & " Rev. " & Format$(app.FileBuild) 

Title: Re: Accessing Project Properties from Code
Post by: Peter House on May 31, 2010, 03:45:11 PM
Thanks Guys.

I searched the forum for everything but APP, I also searched the help file but apparently did not search for APP there either!

Is there any way to auto increment the Product Build?

Thanks again . . .  :)
Title: Re: Accessing Project Properties from Code
Post by: Rolf Brandt on May 31, 2010, 04:16:22 PM
Yes - check in project properties.
Title: Re: Accessing Project Properties from Code
Post by: Peter House on May 31, 2010, 11:11:06 PM
Rolf,

The checkbox in Project Properties is for the Files Build and not the Product Build.

It would be really nice to have the Product Build auto increment also.

Peter
Title: Re: Accessing Project Properties from Code
Post by: Paul Squires on June 01, 2010, 02:06:51 PM
Back in the FireFly 2 days we had a huge discussion about "Product Version" versus "File Version" and the need for an autoincrement for the file version. I can't remember the details of that debate (3 or 4 years ago) but what ended up in FF2 is what was settled on. I used the same when building FF3. Personally, I only really "Product Version".....never really understood the need for the differentiation between the two.  :)

Title: Re: Accessing Project Properties from Code
Post by: Peter House on June 01, 2010, 02:21:24 PM
I am not sure why the need for two.  Currently, I am using the Files version as the Product Version due to the availability of the auto increment feature.

I thought about saying - "Surely there is no need for both" to spark some debate and decided no to  :) .
Title: Re: Accessing Project Properties from Code
Post by: Peter House on June 22, 2010, 09:47:36 AM
I found that setting the Files Build to -1 will produce a build number of 0 on the next build.  If you set the Product Build to -1 the program you compile will not load from within Firefly 3 and Windows reports the file as corrupted and unable to load even thought the compile seems to complete normally.