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[12,1]
if not "foxtools" $ lower(set("library"))
set library to foxtools.fll additive
endif
lgoodinfo = getfileversion(sys(16,1), @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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.