SAS Component Language Dictionary |
Category: | Utility |
Syntax | |
Details | |
Example |
Syntax |
text=MESSAGEBOX(textlist-id<,icon<,buttons
<,caption<,default<,right>>>>>); |
contains the text of the button that a user pressed in the message dialog window. This text can be
ABORT, APPEND, CANCEL, IGNORE, OK, NO, REPLACE, RETRY, YES, or YESTOALL. When a user presses Enter instead of selecting a button, either default is returned (if specified) or the text of the first button in the message window is returned.
contains the identifier for the SCL list that contains the lines of text to display in the message window. Lines that are too long are wrapped. For example, if there are two lines and the first is too long, the text displays as three lines.
specifies the icon to display in the message window:
'I' | |
'?' | |
'!' | |
'S' |
specifies the set of command buttons to display in the message window:
'O' | |
'OC' | |
'YN' | |
'YNC' | |
'YYNC' |
Yes, Yes to all, No, Cancel |
'ARI' | |
'RAC' |
Replace, Append, Cancel |
'RC' |
is a single character that corresponds to one of the characters specified in buttons. Default specifies the value that is returned when a user presses Enter in the message window instead of selecting a button. If default is not supplied, the default selection is the text of the first button in the message window.
specifies whether the text in the message window is right- or left- justified:
'N' | |
'Y' |
Details |
MESSAGEBOX calls a host message window and specifies text to be displayed there. It can also specify an icon, one or more buttons, and a title to display in the window.
If the message window cannot open, or if textlist-id is invalid, the program halts. Otherwise, MESSAGEBOX returns OK, CANCEL, ABORT, RETRY, IGNORE, YES, or NO. On hosts that allow users to close the message window without selecting a button, CANCEL is returned even if it is not one of the button choices.
Example |
Create a window to prompt users to save the latest changes when they close an application window. If no button is selected to close the window, NO is returned to the variable COMMAND.
commandlist=makelist(); commandlist=insertc(commandlist, 'You have not saved the latest changes.',1); commandlist=insertc(commandlist, 'Do you want to save your changes?',2); ...more SCL statements... command=messagebox(commandlist,'!','YN','','N',''); commandlist=dellist(commandlist);
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.