Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

1.      Design the Built-In Function by giving the Built-In Function program a name according to the Naming Conventions for 3GL BIFs on Windows/Linux.

2.      Complete a Built-In Function definition form. You can print the example supplied in Built-In Function Sample Form or one that you have designed yourself. Refer to an example of a 3GL BIF definition, such as Example - A Simple Averaging Function, to understand the composition of the BIF definition.         

Note
Note: This step is not compulsory but it is recommended, especially if you are creating your first Built-In Function. It is meant as an aid to translating your Built-In Function design into the necessary data.

3.      Enter the relevant information into the Built-In Function definition files.

Note

...

Note: The next two steps must be performed. If the Built-In Function is not described in these files then it will not be recognized by LANSA. If this data is incorrect, then the Built-In Function will not work as expected.

4.      Create Definitions in LX_F47 and LX_F48

         There are two available methods for creating Definitions in LX_F47 and LX_F48.

...

Method 1: Define the BIF on

...

IBM i and port to Windows

a.      Define your Built-In Function into the IBM i based table DC@F47 as described in the Create your own 3GL Built-In Functions on IBM i for RDML Functions.

b.      Define your Built-In Function's arguments and return values into the IBM i based table DC@F48 as described in the Examples in Create your own 3GL Built-In Functions on IBM i for RDML Functions.

...

         These are the files that are installed in your x_win95\x_lansa\source directory:

U_BIFNNN.C

A sample/skeleton of a user Built-In C program.

U_BIFNNN.MAK

A sample/skeleton of a make file required to compile and link your C program with Microsoft Visual C/C++ into a DLL under the Windows Operating System.

U_BIFNNN.DEF

A sample/skeleton of a module definition file required to link your C program with Microsoft Visual C/C++ into a DLL under the Windows Operating System.

u_bifnnn.unx

A sample/skeleton of a make file required to compile and link your C program into a shared library under a supported Linux operating system.

U_BIFNNN.ISB

A sample/skeleton of a module definition file required to link your C program into a service program on IBM i.

7.      Edit each of the copied files using a standard source editor such as E or EPM:

File

Description Of Changes

.C

Scan/Replace all "nnn" with "xxx" where xxx is the unique id. Include code appropriate for your requirement.

.MAK

Only required if compiling with Microsoft Visual C/C++. 

Replace "nnn" with "xxx" in the BIFNAME line, where xxx is the unique id.

.DEF

Only required if compiling with Microsoft Visual C/C++.

Replace "nnn" with "xxx" where xxx is the unique id.

Replace xxxxxxxx in DESCRIPTION with a short description of the Built-In Function

.unx

(Only if planning to execute this BIF on Linux.)

Scan/Replace all "nnn" with "xxx" where xxx is the unique id.

.ISB

Only required if planning to execute this BIF on IBM i.)

Replace "nnn" with "xxx" where xxx is the unique id.

Replace xxxxxxxx in the comment area (/* */) with a short description of the Built-In Function

8.      Back up your .C, .MAK, .WMK, .DEF, .unx and .ISB files as soon as possible. This is source code and it needs to be backed up frequently. Accidental loss of source code is a very common problem on unsecured PC systems.

...