Component

Mon 01 January 2018

Syntax

Component  data_type &var_name

Description

Use the Component statement to declare PeopleCode component variables. A component variable, after being declared in any PeopleCode program, remains in scope throughout the life of the component.

The variable must be declared with the Component statement in every PeopleCode program in which it is used.

Declarations appear at the beginning of the program, intermixed with function declarations.

Note: Because a function can be called from anywhere, you cannot declare any component variables within a function. You receive a design time error if you try.

The system automatically initializes temporary variables. Declared variables always have values appropriate to their declared type. Undeclared variables are initialized as null strings.

Not all PeopleCode data types can be declared as Component.

Parameters

Field or Control

Definition

data_type

Specify a PeopleCode data type.

& var_name

A legal variable name.