FoxInfo Structure
The FoxInfo structure is used to communicate function names and parameter descriptions between Visual FoxPro and your FLL library.
The following code illustrates the syntax for a FoxInfo structure:
FoxInfo arrayname[ ] = {
{funcName1, FPFI function1, parmCount1, parmTypes1}
{funcName2, FPFI function2, parmCount2, parmTypes2}
. . .
{funcNameN, FPFI functionN, parmCountN, parmTypesN}
};
The following table describes the parameters in this structure.
Parameter |
Description |
---|---|
arrayname |
Specifies a variable of type FoxInfo. Note You can include several FoxInfo structure lines in this array. |
funcName |
Contains the name that the Visual FoxPro user calls to invoke your function. |
function |
Specifies the address of your C language routine. This is the exact (case-sensitive) name you use to define your function. |
parmCount |
Specifies the number of parameters described in the parmTypes string or one of the following flag values. The following list describes possible flag values:
|
parmTypes |
Describes the data type of each parameter. The following lists the valid values for parmTypes.
|
Note
Include a type value for each parameter passed to the library. To indicate that a parameter is optional, precede it with a period (.). Only trailing parameters can be omitted.
For example, suppose you create a function that accepts a character and a numeric parameter. When you specify parmType, use "CN".
The following example FoxInfo structure defines a library with one function, which is internally named dates and externally accessed as DATES. The structure accepts one Character type parameter:
FoxInfo myFoxInfo[] = {
{ "DATES", (FPFI) dates, 1, "C" }
};
After you compile your FLL library with this FoxInfo structure and load it in Visual FoxPro using the SET LIBRARY command, you can call this function in Visual FoxPro with the following line of code:
=DATES("01/01/95")
See Also
Tasks
How to: Add Visual FoxPro API Calls
Concepts
Creating Visual FoxPro Dynamic-Link Libraries