The Run Submenu and Display Submenu Statements
4GL supports two statements, run submenu and display submenu, which allow you to display a submenu without an attached query. The submenu is a display construct consisting of the double keywords run submenu or display submenu followed by an operation list consisting of activations and statement blocks. It replaces the original menu line for the form.
The principle difference between the run submenu and display submenu statements is in the way each is used:
• Use display submenu with an operation list when you want the form to remain active; the user has access to the fields on the form while the menu is displayed.
• Use run submenu with an operation list if you want the form to be inactive; the cursor stays on the menu line, and you must make a selection before regaining access to the form.
The following example shows a display submenu block, which lets you insert, delete, and clear rows while updating a table field.
'Employee_table' =
begin
display submenu
begin
'Insert' =
begin
insertrow emptbl;
end
'Delete' =
begin
deleterow emptbl;
end
'End', key frskey3 =
begin
endloop;
end
end
end
These two statements are discussed in more detail in
4GL Statement Glossary.