×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Here is one of my main display control loops. It's job is to make decision
and dispatch to lower levels to perform actions.

I use one module for each screen so each module is independent. When
finished, it is bound together to form a single program.

* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* ProcessScreen03
* Do processing for Screen Three - Standard Single Page Load
Subfile Panel.
* Input - None
* Out - None
* Returns - Key Pressed
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
dcl-proc ProcessScreen03 Export;
dcl-pi *N Like(StdChr) end-pi;

dcl-s KeyPressed Like(StdLgl);

// Build user space to hold records when we do a Fetch.
BuildIOUserSpace();

If Not g_ScreenOpen;
Open TG0001_D01;
g_ScreenOpen = cTrue;
EndIf;

// Default is to display first file name.
O_CURPOSTO = ' ';
B_NEWPOSTO = ' ';
O_FILTERBY = ' ';

MSGF_ClearProgramMessageQueue(cMainProcedureName:
g_dsSystem.ModuleName:
g_ProgramName);

LoadAll();

DoW cTrue;

// Display subfile messages.
DisplaySubfileEndOnSubfileMessageQueue = cTrue;
SFM_C_PGMQ = '*';
Write SFMSG_CTL;

If g_RecordsLoadedInSubfile > 0;
DisplaySubFile = cTrue;
Else;
DisplaySubfile = cFalse;
Write RD01_03E;
EndIf;
DisplaySubFileControl = cTrue;

Write RD01_03O;
ExFmt RD01_03C;

MSGF_ClearProgramMessageQueue(cMainProcedureName:
g_dsSystem.ModuleName:
g_ProgramName);

MSGF_ClearIndicators(dsIndicators:
cStartErrorIndicators:
cEndErrorIndicators);

DisplaySubfile = cFalse;
DisplaySubfileControl = cFalse;

Select;
When g_dsFileInformation01.KeyPressed = F3 or
g_dsFileInformation01.KeyPressed = F12;
Return g_dsFileInformation01.KeyPressed;

// F5 = Reload screen.
When g_dsFileInformation01.KeyPressed = F5;
LoadAll();
Iter;

// F6 = Add Record Request.
When g_dsFileInformation01.KeyPressed = F6;
If ProcessScreen04(' ' :
' ' :
cAddRecordMode) = F3;
Return F3;
EndIf;
O_CURPOSTO = *Blanks;
LoadAll();
Iter;

// F9 = Filter By.
When g_dsFileInformation01.KeyPressed = F9;
GetFilterByName();
LoadAll();
Iter;

// F10 = Display All Records.
When g_dsFileInformation01.KeyPressed = F10;
If g_ShowAllLevels = cTrue;
g_ShowAllLevels = cFalse;
Else;
g_ShowAllLevels = cTrue;
EndIf;
LoadAll();
Iter;

// Any other key pressed.
Other;
If PositionToChanged;
O_CURPOSTO = B_NEWPOSTO;
B_NEWPOSTO = *Blanks;
LoadAll();
Iter;
EndIf;

// If nothing loaded, redisplay subfile.
If g_RecordsLoadedInSubfile <= 0;
Iter;
EndIf;

//Check for options selected.
KeyPressed = GetSelectedRecords();
If KeyPressed = F3;
Return F3;
EndIf;

If KeyPressed = F12;
Iter;
EndIf;

//Call function to display delete screen. If nothing, will
just return.
//F12 means abort request. Redisplay screen.
If ProcessScreen05() = F12;
Iter;
EndIf;

// Else, normal end. Reload subfile.
LoadAll();
Iter;
EndSl;
EndDo;

Return ' ';

end-proc;

TG0001 RPGLE Maintain Trigger Cntrl Data
TG0001_D01 DSPF Maintain Trigger Cntrl Data-Display File 01
TG0001_LPR RPGLE Maintain Trigger Cntrl Data-Local Prototypes
TG0001_M00 RPGLE Maintain Trigger Cntrl Data-Top Level
TG0001_M01 RPGLE Maintain Trigger Cntrl Data-Screen 01-Menu
TG0001_M02 RPGLE Maintain Trigger Cntrl Data-Screen 02-Header
TG0001_M03 SQLRPGLE Maintain Trigger Cntrl Data-Screen 03-Detail Subfi
TG0001_M04 SQLRPGLE Maintain Trigger Cntrl Data-Screen 04-Add/Edt/Dlt
TG0001_M05 SQLRPGLE Maintain Trigger Cntrl Data-Screen 05-Confirm Dlt.
TG0001_M06 SQLRPGLE Maintain Trigger Cntrl Data-Screen 06-Add Trig
TG0001_M07 SQLRPGLE Maintain Trigger Cntrl Data-Screen 07-Rmv Trig
TG0001_M08 SQLRPGLE Maintain Trigger Cntrl Data-Screen 08-Detail Subfi
TG0001_M09 SQLRPGLE Maintain Trigger Cntrl Data-Screen 09-Add/Edt/Dlt
TG0001_M10 SQLRPGLE Maintain Trigger Cntrl Data-Screen 10-Confirm Dlt.
TG0001_M11 SQLRPGLE Maintain Trigger Cntrl Data-Screen 11-Libraries Su
TG0001_M12 SQLRPGLE Maintain Trigger Cntrl Data-Screen 12-Add/Edt/Dlt
TG0001_M13 SQLRPGLE Maintain Trigger Cntrl Data-Screen 13-Confirm Dlt.
TG0001_M50 CLLE Maintain Trigger Cntrl Data-Add Trigger Mediator
TG0001_M51 CLLE Maintain Trigger Cntrl Data-Rmv Trigger Mediator

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.