Understanding type definition
This is an introduction to types.
The
TYPE
instruction declares a user-defined type, which can be based on:- Primitive data types (
INTEGER
,VARCHAR(n)
), - Records (
RECORD ... END RECORD
,RECORD ... LIKE tabname.*
), - Arrays (
DYNAMIC ARRAY OF ...
), - Dictionaries (
DICTIONARY OF ...
), - Function types (
FUNCTION name(type,...) RETURNS ...
)
Once declared, a type can be referenced in the declaration of program variables, or in other types.
Types are typically defined to avoid the repetition of complex structured types.
Tip: User-defined types improve code readability by centralizing data structure
definitions. Consider using
PUBLIC TYPE
definitions to share types across modules
with IMPORT FGL
.