You can use the EGL Text UI technology to create a very basic user interface, like one you would find on a mainframe. This means you can generate programs for both COBOL and Java™ that present an identical interface to the user.
Text UI interfaces are based on forms. A form contains fields that are displayed together on a screen page or sent together to a printer. Properties determine how each field is displayed or printed within the form.
Each EGL Form part must be part of a FormGroup.
Text UI programs carry on a conversation with the user. The EGL converse statement gives control to the form; when the user presses a key, control returns to the program and the program processes the information in the form.
FormGroup myFormGroup
Form myTextForm type textForm {formSize=[10,80]}
msgField CHAR(80);
end
end
Program HelloWorld type textUIprogram
{}
use myFormgroup;
myMessage char(25) = "myMessage";
function main()
while (ConverseVar.eventKey not pf3)
myTextForm.msgField = myMessage;
converse myTextForm;
if (ConverseVar.eventKey is pf3)
exit program;
end
if (ConverseVar.eventKey is pf1)
myMessage = "Hello World";
end
end
end
end
If you press the F1 key, the message changes from "myMessage" to "Hello World". If you press the F3 key, the program exits.