|
This thread has certainly come a long way. For *STATUS messages, there is nothing one can do about the 75 character limit. DSPMSGD CPF9898 QCPFMSG shows me that my V4R4 system has 512 bytes of level 1 text available. That *should* work for most general purpose impromptu messages. But since we've moved on to: >So how about this: You write a small CL utility program. Upon an error >you want to display your own message DCL1001 (Dan's CL message 1001). >Is it possible to MONMSG that the message was not found, call another CL >that adds the message to QCPFMSG and upon return your utility CL loops >back to show the message? So you write a program (ADDDCLMSG or some >such) and pass to it which message that needs to be added and this way >you also have a single program that contains all of your own utility >messages? Since we're discussing adding our own messages to QCPFMSG, may I suggest an alternative? Message file processing has a special override function that will probably suffice for the purpose. If you have your own message file and you put your own CPF9898 message in it and then issue OVRMSGF, OS/400 will override _only the messages in YOUR file_. This means you can leave QCPFMSG alone and keep all your messages (logically enough) in a message file. Here is a quick code sample to start you off: pgm /* CRTMSGF MSGF(BUCK/GP) */ /* TEXT('General purpose messages - OVRMSGF QCPFMSG GP') */ /* ADDMSGD MSGID(CPF9898) MSGF(GP) MSG('&1.') SECLVL('Second level text: &2') */ /* FMT((*CHAR 512) (*CHAR 512)) */ DCL &first *char 512 DCL &second *char 512 chgvar &first 'First level text goes here' chgvar &second 'Second level text (details?) goes here' /* use the default message file */ sndpgmmsg msgid(cpf9898) msgf(qcpfmsg) + msgdta(&first *cat &second) topgmq(*prv) sndpgmmsg msgid(cpf9897) msgf(qcpfmsg) + msgdta(&first *cat &second) topgmq(*prv) /* Try the override */ ovrmsgf qcpfmsg gp sndpgmmsg msgid(cpf9898) msgf(qcpfmsg) + msgdta(&first *cat &second) topgmq(*prv) sndpgmmsg msgid(cpf9897) msgf(qcpfmsg) + msgdta(&first *cat &second) topgmq(*prv) endpgm This behaviour originated on the System/38 and is currently documented in the CL Programming manual, Chapter 7 Defining messages and Chapter 8 Working with messages. Here is a direct link to the V4R4 OVRMSGF topic: http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/qb3auo02/7.3.2 I'm a bit surprised Bruce hasn't chimed in on this yet. OVRMSGF is a great way to internationalise "other" vendor message files... Buck Calabro Commsoft; Albany, NY "Nothing is so firmly believed as that which we least know" -- Michel Montaigne Visit the Midrange archives at http://www.midrange.com +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.