AGetFileVersion()

This function, added in VFP 6, lets you check on the version information built into a file. It's a native replacement for the GetFileVersion() function that was added to FoxTools in VFP 5.

Usage

nRows = AGetFileVersion( VersionArray, cFileName )
If the specified file has version information, VersionArray is created (or resized) with 15 rows and the function returns 15. (No doubt the exact number will change in future versions.) The contents of the rows are documented in Help. If the file doesn't exist or doesn't have version information, the array isn't created (or is unchanged if it already existed) and the function returns 0.AGetFileVersion() gives us three pieces of information we could not get with FoxTool's GetFileVersion(). The lucky 13th element of the array tells us whether the file is capable of OLE Self-Registration, an important item when installing new ActiveX services on a machine or troubleshooting the ones that are there. The 14th and 15th elements give us the string and hexadecimal descriptions of the language in which this file was localized.Oh, you're wondering how to give a file version information. From the Build Options dialog, click Version and you can fill it in. Programmatically, you use the various File properties whose names begin with "Version."

This function works on all kinds of executable files, not just those you create with VFP. You can go poking around all kinds of places to see what's out there.


Example

? AGetFileVersion(aFileVer, HOME()+"VFP7.exe") && Returns 15

See Also

Build, VersionComments, VersionCompany, VersionCopyright, VersionDescription, VersionLanguage, VersionNumber, VersionProduct, VersionTrademarks


Back to Table of Contents

Copyright © 2002-2018 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. Click for license .