AGETFILEVERSION( ) Function

See Also

Creates an array containing information about files with Windows version resources such as .exe, .dll, and .fll files, or automation servers created in Visual FoxPro.

Syntax

AGETFILEVERSION(ArrayName, cFileName)

Returns

Numeric

Arguments

ArrayName

Specifies the name of the array in which the file information is placed. If the array you specify doesn't exist, Visual FoxPro automatically creates the array. If the array exists and isn't large enough to contain the file information, Visual FoxPro automatically increases the size of the array. If the array is larger than necessary, Visual FoxPro truncates the array.

The following table lists the contents of each element of the array.

Element Contents
1 Comments
2 Company Name
3 File Description
4 File Version
5 Internal Name
6 Legal Copyright
7 Legal Trademarks
8 Original File Name
9 Private Build
10 Product Name
11 Product Version
12 Special Build
13 OLE Self Registration (contains "OLESelfRegister" if the file supports self-registration; otherwise contains the empty string)
14 Language (derived from the Translation Code)
15 Translation Code

For example, you can use the following code to determine the Locale ID for the Visual FoxPro executable file:

DIMENSION aFiles[1]
AGETFILEVERSION(aFiles,"VFP6.EXE")
? EVAL("0x"+LEFT(aFiles[15],4))
** Returns 1033 for US version

cFileName

Specifies the name file for which information is placed in the array. The class library name you specify is displayed in the File name text box. An error is generated if the class library you specify doesn't exist.

Remarks

AGETFILEVERSION( ) is typically used to get information about files with Windows version resources such as .exe, .dll, and .fll files, or automation servers created in Visual FoxPro. You must specify a value for at least one item in the EXE Version dialog Box for a Visual FoxPro automation server to have Windows version resources.

AGETFILEVERSION( ) returns the number of elements in the array. If the file you specify doesn’t contain Windows version resources, zero is returned and the array (if already created) remains unchanged.

The minimum number of characters to which AGETFILEVERSION( ) can be abbreviated is 5 characters.