6.1 Function Format
Each LANSA Open function is described using this format, based on the structure of a 'C' function line:
Returns |
LceFunction |
(param-type |
parameter1, |
|
|
param-type |
parameter2 ) |
Parameters
Param-type indicates the type of value for the parameter, while parameter1 and parameter2 represent the actual variable you will declare and use in your application.
Valid param-types include:
Char far * |
A 4 byte pointer to a character string in C or a simple character string in most other languages. |
Float far * |
A 4 byte pointer to a floating point value in C or a floating point (decimal) number in most other languages. |
Int far * |
A 4 byte pointer to an integer value in C or an integer in most other languages. |
Long far * |
A 4 byte pointer to a long integer value in C or an integer in most other languages. |
Int |
An integer. |
BOOL |
A boolean variable (TRUE or FALSE). |
HWND |
A string representing the Window Handle or identifier. |
Some examples of parameter1 and parameter2 you will see are:
strNumericString |
To represent a character string containing numerics. |
strFileName |
To represent a character string containing a file name. |
isession |
To represent an integer variable storing the session identifier. |
FOK |
To represent a boolean variable (TRUE/FALSE). |
The actual length of a parameter is indicated by the supplied field name as used in the LCOE.H header file, supplied for use with 'C' programs.
Return Values
Represented by 'Returns' in the function format, this is the value that the function returns when it is called.
Valid values include:
VOID |
No value is returned |
When a void or no value is returned, you might use the function in the following manner:
|
or
|
BOOL |
A boolean value is returned. TRUE is 1 FALSE is 0. False normally results in an error code. A list of the error codes is in Appendix A of this guide. |
When a boolean value is returned, you might use the function in the following manner:
|
or
If LceFunction(parameter1, parameter2)
|
or
in Visual Basic
|
int |
An integer number is returned. |
Long |
A long integer is returned. |
When an integer or long integer is returned, you might use the function in the following manner:
|
Notes
This section provides important notes regarding the use of the function.
Portability Considerations |
This section will also note any differences that may be encountered between using IBM is and other platforms as the hosts. A general discussion regarding host platform differences may be found in Things That May Be Different in the Guide's chapter: Generated Code C and SQL/ODBC Considerations. |
Tips
If there is a more efficient way of using the LANSA Open function, it will be described in the Tips section.
For the latest LANSA Open tips and program samples, check out LANSA's web site at http://www.lansa.com/support
Related Functions
This section lists any other related functions or important areas of this guide that you should review.