Often there is a need to display a message to the user either in response to a query or just as reminder of some kind. If the message is short using @W.return or @W.err in an attribute works fine. Sometimes though you need to display more than a few words. This can be done by putting the text you want to display in the documentation of the query and then using then MIS.SCREEN.display.doc program in an attribute.

Using @W.return or @W.err

Display a simple message on entry to a query.


IFE=@W.return("This is the message"),1

Display a simple message if the response to a query is Y.

FCL1=IF{@.response="Y" @W.return("This is the message")}

Using MIS.SCREEN.display.doc

Enter the text you want to display in the documentation for the query. This is done by entering Y at the documentation prompt for the query in the CDS dictionary. These attributes will display that text in the standard yellow documentation window titled DOCUMENTATION.

Display the documentation text on entry to a query. Replace MYSCREEN with the actual mnemonic of your CDS and QUERY with the mnemonic of your query.

IFE=%MIS.SCREEN.display.doc("MYSCREEN","QUERY"),1

Display the documentation if the response to a query is Y. Again replace MYSCREEN with the actual mnemonic of your CDS and QUERY with the mnemonic of your query.

FCL1=IF(@.response="Y" 1,
FCL1=%MIS.SCREEN.display.doc("MYSCREEN","QUERY")}

Using a modified version MIS.SCREEN.zcus.pgm.M.display.doc

It's getting better. You now have practically no limit on how much text you can display but it can be improved. For one thing the window is always titled DOCUMENTATION. That has to go. Also it would be nice to sometimes have a red or green or blue background instead of yellow. I have created my own version of the MIS.SCREEN.display.doc program that accepts 2 additional arguments - one for color and another for window title. I've put 4 variables in the attributes below to save space. You should replace them with the real information.

A - mnemonic of the CDS in quotes
B - the mnemonic of the query
C - color scheme number (see list below)
D - title to use for the window in quotes

ex. %MIS.SCREEN.zcus.pgm.M.display.doc("MYCDS","QUERY",9,"My Window Title")

Display the documentation text on entry to a query. Replace MYSCREEN with the actual mnemonic of your CDS and QUERY with the mnemonic of your query.

IFE=%MIS.SCREEN.zcus.pgm.M.display.doc(A,B,C,D),1


Display the documentation if the response to a query is Y. Again replace MYSCREEN with the actual mnemonic of your CDS and QUERY with the mnemonic of your query.

FCL1=IF(@.response="Y" 1,
FCL1=%MIS.SCREEN.zcus.pgm.M.display.doc(A,B,C,D)}


Sample Color Values

Note that the color listed here are based on tests using magic 4.9 and workstations 3.21 and 4.02. There have been many changes and upgrades since then. The colors you get when using these values, especial for NUI, may not be the same.

Non-NUI Background Colors
0 Black
1 Blue
2 Dark Blue
3 Blue
4 Light Green
5 Dark Green
6 Red
7 Dark Red
8 Yellow
9 Light Yellow - default

Acceptable NUI/GUI colors
2,5,7,9,12,15 Black on white
3 Red on gray
14 Black on gray
18,21,23,25,28 white on black
19 gray on red

all others are not fixed width and could cause display problems for NUI

Download the NPR report containing the macro here.

New Display Program in 5.5

See Magic Message With Text page


Other Magic Pages



Don't see what you need?  Visit one of these other sites


or email me your request (tomt at thomast357.com).