9 21 COMPILE_COMPONENT

LANSA Technical

9.21 COMPILE_COMPONENT

Þ Note: Built-In Function Rules.

This BIF compiles a component.

Þ This is a Specialized Built-In Function for use in a Development Environment only.

For use with

LANSA for i

NO

 

Visual LANSA for Windows

YES

Visual LANSA initiates the compile process and does not return control until the compile is complete.

Visual LANSA for Linux

NO

 

 

 

Arguments

No.

Type

Req/

Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

L

Req

Working List Name. The working list must have an aggregate length of 9 bytes.

Each list entry should be formatted as follows:

Bytes 1-9: A(9), Component Name

1

9

 

 

2

A

Opt

Force Compile (YES/NO).
When this option is NO, only those components that need to be are compiled, otherwise all the components are compiled.

Default: NO

2

3

 

 

3

A

Opt

Keep the generated source code (YES/NO).

Default: NO

2

3

 

 

4

A

Opt

Compile for debug (YES/NO).

Default: NO

2

3

 

 

5

A

Opt

Web services to compile (A/W/N)

A - All Web Routines
W - New Web Routines only
N - None.

Default: N

1

1

 

 

6

L

Opt

Working List Name. The working list must have an aggregate length of 21 bytes.

Each list entry should be formatted as follows:

Technology Services identifier. A(21). This should be specified in the following format <Provider>:<Technology Service Name>.
For example, LANSA:XHTML

1

21

 

 

 

 

Return Values

No.

Type

Req/

Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Return code.
The component may fail if it doesn't pass the build process or is locked.

OK = successful submission of compile.

NR = No compilable components found in list.

ER = argument details are invalid or an authority problem has occurred. In this case, return code error message(s) are issued automatically.

2

2

 

 

 

 

Example

A user wants to control the compilation of components using their own version of the "Compile / Re-Compile a Component" facility.

*********  Define arguments and lists
DEFINE     FIELD(#COMPNAME) TYPE(*CHAR) LENGTH(9)
DEFINE     FIELD(#RETCOD) TYPE(*CHAR) LENGTH(2)
DEF_LIST   NAME(#WKCOMP) FIELDS(#COMPNAME) TYPE(*WORKING)
DEF_LIST   NAME(#BWCOMP) FIELDS(#COMPNAME)
*********  Clear working and browse lists
BEGIN_LOOP
CLR_LIST   NAMED(#WKCOMP)
INZ_LIST   NAMED(#BWCOMP) NUM_ENTRYS(2) WITH_MODE(*CHANGE)
*********  Request component names
REQUEST    BROWSELIST(#BWCOMP)
*********  Move components from the browselist to the working list
SELECTLIST NAMED(#BWCOMP)
ADD_ENTRY  TO_LIST(#WKCOMP)
ENDSELECT
*********  Execute built-in-function - COMPILE_COMPONENT
USE        BUILTIN(COMPILE_COMPONENT) WITH_ARGS(#WKCOMP) TO_GET(#RETCOD)
*********  Check if submission was successful
IF         COND('#RETCOD *EQ ''OK''')
MESSAGE    MSGTXT('Compile Component submitted successfully')
ELSE
MESSAGE    MSGTXT('Compile Component submit failed with errors, refer to additional messages')
ENDIF
END_LOOP