H DFTACTGRP(*NO) H COPYRIGHT('Example of F23=More options. Public Domain by Simon Coulter.') H DEBUG(*YES) H DATEDIT(*YMD/) H OPTION(*SRCSTMT : *NODEBUGIO) D QuiOpenDspApp PR EXTPGM('QUIOPNDA') D appHandle 8 D qualPnlGrp 20 CONST D appScope 10I 0 CONST D exitParmItf 10I 0 CONST D helpFull 1 CONST D errCode 1024 OPTIONS(*VARSIZE) D QuiCloseApp PR EXTPGM('QUICLOA') D appHandle 8 CONST D closeOption 1 CONST D errCode 1024 OPTIONS(*VARSIZE) D QuiDspPnl PR EXTPGM('QUIDSPP') D appHandle 8 CONST D function 10I 0 D pnlName 10 CONST D redsplyOption 1 CONST D errCode 1024 OPTIONS(*VARSIZE) D QuiPutDlgVar PR EXTPGM('QUIPUTV') D appHandle 8 CONST D varBuffer 32767 CONST D varBufferLen 10I 0 CONST D varRcdName 10 CONST D errCode 1024 OPTIONS(*VARSIZE) D QuiAddListEntry... D PR EXTPGM('QUIADDLE') D appHandle 8 CONST D varBuffer 32767 CONST D varBufferLen 10I 0 CONST D varRcdName 10 CONST D listName 10 CONST D listOption 4 CONST D listEntHandle 4 D errCode 1024 OPTIONS(*VARSIZE) * UIM constants D $UI_REDISPLAY_YES... D C CONST('Y') D $UI_FULL_HELP_NO... D C CONST('N') D $UI_UIM_WAIT_FOREVER... D C CONST(-1) D $UI_APP_SCOPE_CALLER... D C CONST(-1) D $UI_EXIT_PARM_ITF_STRUCT... D C CONST(0) D $UI_FUNC_ENTER... D C CONST(0) D $UI_FUNC_EXIT... D C CONST(-4) D $UI_FUNC_CANCEL... D C CONST(-8) D $UI_LIST_OPT_FIRST... D C CONST('FRST') D $UI_CLOSE_OPT_NORMAL... D C CONST('M') D $F23 C CONST(123) D $MAX_OPT_ROWS C CONST(5) * UIM API declarations D appHandle S 8 D userFunction S 10I 0 D listEntryHandle... D S 10 * UIM variable pool declarations D varpool DS D rowOpt 5I 0 D record1 DS D option 5I 0 D column1 10 D column2 10 D column3 10 D column4 10 D column5 10 * API error code data structure D Qus_Ec DS INZ D Qus_Ec_Bytes_Prov... D 10I 0 D Qus_Ec_Bytes_Avail... D 10I 0 D Qus_Ec_Excp_Id... D 7 D Qus_Ec_Rsvd... D 1 D Qus_Ec_Excp_Dta... D 128 /FREE // Force API errors (during testing) Qus_Ec_Bytes_Prov = *ZERO; // Open the UIM application QuiOpenDspApp( appHandle : 'F23MOREOPG*LIBL ' : $UI_APP_SCOPE_CALLER : $UI_EXIT_PARM_ITF_STRUCT : $UI_FULL_HELP_NO : Qus_Ec ); // Set dialogue variables // Force display of first row of options rowOpt = 1; QuiPutDlgVar( appHandle : varPool : %SIZE(varPool) : 'VARPOOL' : Qus_Ec ); // Stick one entry in the list for testing option = 0; column1 = 'ABCDEFGHIJ'; column2 = 'KLMNOPQRST'; column3 = 'UVWXYZ1234'; column4 = '567890-+=_'; column5 = '!@#$%^&*()'; QuiAddListEntry( appHandle : record1 : %SIZE(record1) : 'RECORD1' : 'LIST' : $UI_LIST_OPT_FIRST : listEntryHandle : Qus_Ec ); // Until the user requests exit ... DOU ( userFunction = $UI_FUNC_ENTER OR userFunction = $UI_FUNC_EXIT OR userFunction = $UI_FUNC_CANCEL ); // Display the UIM panel QuiDspPnl( appHandle : userFunction : 'EXAMPLE' : $UI_REDISPLAY_YES : Qus_Ec ); // User pressed F23=More options? IF ( userFunction = $F23 ); // Condition next row of options /IF DEFINED(*V5R3M0) rowOpt += 1; /ELSE rowOpt = rowOpt + 1; /ENDIF // If more than the maximum allowed then force first row IF ( rowOpt > $MAX_OPT_ROWS ); rowOpt = 1; ENDIF; QuiPutDlgVar( appHandle : varPool : %SIZE(varPool) : 'VARPOOL' : Qus_Ec ); ENDIF; ENDDO; // Close the UIM application QuiCloseApp( appHandle : $UI_CLOSE_OPT_NORMAL : Qus_Ec ); /END-FREE * End the program and go home C SETON LR C RETURN