The syntax diagram for a program part of type textUIProgram
is as follows:
- Program programPartName ... end
- Identifies the part as a program part and specifies the name and type.
If the program name is followed by a left parenthesis, the program is a called
basic program.
If you do not set the alias property
(as described later), the name of the generated program is programPartName.If you do not set the alias property
(as described later), the name of the generated program is either programPartName or,
if you are generating COBOL, the first eight characters of programPartName.
For
other rules, see Naming conventions.
- mainTextUIProperties
- The properties for a main text UI program are optional:
- alias
- allowUnqualifiedItemReferences
- handleHardIOErrors
- includeReferencedFunctions
- inputForm
- inputRecord
- localSQLScope
- msgTablePrefix
- segmented
- throwNrfEofExceptions
For details, see Program properties.
- parameter
- Specifies the name of a parameter, which may be a data item, record, or
form; or a dynamic array of records or data items. For rules, see naming
conventions.
If the caller's argument is a variable (not a constant
or literal), any changes to the parameter change the area of memory available
to the caller.
Each parameter is separated from the next by a comma.
For other details, see Program parameters.
- calledProperties
- The called properties are optional:
- alias
- allowUnqualifiedItemReferences
- includeReferencedFunctions
- msgTablePrefix
For details, see Program properties.
- programData
- Variable and use declarations, as described in Program data other than
parameters.
- mainFunctionPart
- A required function named main, which takes
no parameters. (The only program code that can take parameters is the program
itself and functions other than main.)
For details on writing a function,
see Function part in EGL source format.
- functionPart
- An embedded function, which is not available to any logic part other than
the program. For details on writing a function, see Function part in EGL
source format.
An example of a Text UI program is as follows:
Program HelloWorld type textUIprogram
{}
use myFormgroup;
myMessage char(25);
function main()
while (ConverseVar.eventKey not pf3)
myTextForm.msgField = " ";
myTextForm.msgField="myMessage";
converse myTextForm;
if (ConverseVar.eventKey is pf3)
exit program;
end
if (ConverseVar.eventKey is pf1)
myMessage = "Hello Word";
end
end
end
end