Tip

Display a simple text window without using a display file

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 after pouring some coffee" or as complex as you can fit into 16MB. The text is automatically word-wrapped and scrollable, though unfortunately there are no formatting options -- it is a block of text with no paragraph or line-breaks. Text may be constructed on the fly.

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.