The UIM Display Long Text (QUILNGTX) API provides a handy way to display a simple text window without requiring a display file. Text can be as simple as "Press
The sample CL code shows retrieving the text from the second-level text of a message in a message file. The window title is automatically taken from the first-level text of a supplied message ID. This API can sometimes remove the need to waste your only DCLF for a display file in a CL program.
pgm ( +
&pMsgId +
&pMsgF +
&pMsgFLib +
)
dcl &pMsgId *char 7
dcl &pMsgF *char 10
dcl &pMsgFLib *char 10
dcl &@yes *lgl value( '1' )
dcl &@no *lgl value( '0' )
dcl &msgf *char 10
dcl &msgflib *char 10
dcl &msgID *char 7
dcl &msgtxtlen *dec ( 5 0 )
/* Variables for QUILNGTX API */
dcl &LngTxt *char 999
dcl &TxtLen *char 4
dcl &TxtTitl *char 7
dcl &TxtMsgf *char 20
dcl &ErrCode *char 4
chgvar &msgId &pMsgId
chgvar &msgf &pMsgF
chgvar &msgflib &pMsgFLib
/*--------------------------------------------------*/
/* Say something useful. */
/*--------------------------------------------------*/
chgvar &TxtTitl &msgId
Qsys/rtvmsg &msgId +
msgf( &msgflib/&msgf ) +
seclvl( &LngTxt ) +
seclvllen( &msgtxtlen )
chgvar %bin( &TxtLen 1 4 ) &msgtxtlen
chgvar &TxtMsgf ( &msgf *cat &msgflib )
call QUILNGTX ( +
&LngTxt +
&TxtLen +
&TxtTitl +
&TxtMsgf +
&ErrCode +
)
Exit:
Qsys/rmvmsg msgq( *PGMQ ) clear( *ALL ) rmvexcp( *NO )
monmsg ( cpf0000 mch0000 )
return
EndPgm
This was first published in June 2001