Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I retrieve my app's version number?

Tips -N- Tricks

How do I retrieve my app's version number?

by  foxdev  Posted    (Edited  )
Visual FoxPro 6 contains the function aGetFileVersion which can retrieve version and other information from VFP and non-VFP Windows EXEs and DLLs.

For Visual FoxPro version 5, you can obtain this information on the currently-running VFP-created EXE by using the GetFileVersion() function in FOXTOOLS.FLL. The code follows:

<font color=blue>[tt]
* -- uses GetFileVersion function in FoxTools.FLL (VFP version 5)
* -- returns info on currently-running VFP EXE
* -- supplied when the EXE was built
* -- (version, company info, description, etc.)
* -- optional parameter - pass .T. to get full info, .F. or nothing to get just version

lparameter tlreturnfulldescription

local afileinfo && array to hold file information
local lgoodinfo && good getfileversion() flag
local cretval && return value

dimension afileinfo&#91;12,1]

if not "foxtools" $ lower(set("library"))
set library to foxtools.fll additive
endif

lgoodinfo = getfileversion(sys(16,1), &#64;afileinfo) >= 0
if lgoodinfo && GetFileVersion performed OK
if tlreturnfulldescription && give full info
cretval = afileinfo(10,1) + " " + ;
afileinfo(4,1) + " " + ;
afileinfo(3,1) + " " + ;
afileinfo(1,1) + " " + ;
chr(169) + afileinfo(6,1)
else
cretval = afileinfo(4,1) && version only
endif
else
cretval = ""
endif

return cretval
[/tt][/tt]
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top