Was this helpful?
Database Frame
The Database Frame shown in the following figure is a user-specified frame coded in 4GL. With this frame, the user can use QBF to examine the Emp, Tasks, and Projects tables from the database.
The single field in the form uses the field activation capabilities of 4GL to select a table with a single keystroke. The Task_Assignments menu operation starts QBF with a Join Definition between the Emp and Tasks tables. The 4GL source code for this frame follows.
/* database.osq */
field 'selection' =
begin
set_forms field " (normal(selection)=1);
if selection = 'a' then
helpfile 'Database Design'
'USER:[JOE.ABFDEMO]design.txt';
elseif selection = 'b' then
call qbf (qbfname = 'emp', mode = 'retrieve');
elseif selection = 'c' then
call qbf (qbfname = 'tasks', mode = 'retrieve');
elseif selection = 'd' then
call qbf (qbfname = 'projects', mode = 'retrieve');
else
set_forms 'field' " (blink(selection)=1);
message 'Selection must be a, b, c, or d'
with style=popup;
endif;
end
'Task_Assignments' =
begin
callframe task_assignments;
end
'4GL', key frskey16 =
begin
helpfile 'Database Frame 4GL'
'USER:[JOE.ABFDEMO]database.osq';
end
'Help', key frskey1 =
begin
help_forms(subject='Database Information',
file = 'USER:[JOE.ABFDEMO]database.hlp);
end
'Quit', key frskey3 = 
begin
callproc timer_on (secs = 2);
return;
end
key frskey2 = 
begin
exit;
end
on timeout = 
begin
callproc timer_off;
end
Last modified date: 11/09/2022