Sets the ABL PROMSGS variable for the current ABL session. The PROMSGS variable holds the name of the current ABL message file. ABL supplies different versions of this file to support various languages.
This example prompts the user for a language name and then tries to find a message file for that language. If the message file is found, then the PROMSGS statement is used to make that the current message file. Subsequently, all ABL system messages are read from the new promsgs file. The PROMSGS function is used in an informative message.
r-swmsgs.p
DEFINE VARIABLE newlang AS CHARACTER NO-UNDO FORMAT "x(16)" LABEL "Language". DEFINE VARIABLE msgfile AS CHARACTER NO-UNDO. SET newlang HELP "Enter the new language for messages.". msgfile = IF newlang = "English" THEN "promsgs" ELSE "prolang/promsgs." + LC(SUBSTRING(newlang, 1, 3)). IF SEARCH(msgfile) < > ? THEN DO: PROMSGS = msgfile. MESSAGE "Messages will now be taken from" PROMSGS. END. ELSE DO: MESSAGE "Cannot find" msgfile. UNDO, RETRY. END. |