Chapter Contents |
Previous |
Next |
BLOCK |
Category: | Window |
Syntax | |
Details | |
Values For The Color Argument | |
Example | |
See Also |
Syntax |
choice=BLOCK(window-name,title,color,text-1,
. . . , text-12<,icon-1, . . . , icon-12>); |
Type: Character
Type: Character
Type: Numeric
Type: Character
Type: Numeric
Details |
The number of text values that you specify determines how many blocks of icons are displayed in the menu. In order to display an icon menu, you must specify at least one icon position, although you can display the default SAS icon by specifying 0 for positions for which a value for text is supplied.
Because BLOCK does not generate a physical display window, window options such as KEYS are not recognized. The BLOCK function windows recognize only DMKEYS settings. To alter DMKEYS settings for a BLOCK menu, you can use GETFKEY and SETFKEY in a program that runs before the BLOCK menu opens. This program must have a display screen associated with it.
This function attempts to display the blocks in the best manner depending upon the characteristics of the user's display device. The function displays up to three rows of four blocks. Blocks are displayed in the order in which the text arguments appear in the function. Only the nonblank choices are displayed, and the blocks in each row are centered in the row.
When the function is called, it queries the current value of choice. If the value of choice corresponds to a valid selection number, the cursor is positioned on the correct block. Otherwise, the cursor is positioned in the upper-left corner of the window.
To make a selection from the block menu, a user must move the cursor to the appropriate block and then press ENTER or click the mouse. BLOCK returns the index of the selection.
If a user presses the HELP key on one of the selections, then the negative of the selection is returned. If a user presses the HELP key while the cursor is not on one of the blocks, then the value -99 is returned.
If a user issues the END or CANCEL command via a function key, then the value 0 is returned.
Use ENDBLOCK to close the menu window that is opened by BLOCK.
Values for the Color Argument lists values that can be used for color.
Values For The Color Argument |
Color | Background | Border | Text | Icon | Shadow | |
---|---|---|---|---|---|---|
0 | black | white | white | white | white | |
1 | black | gray | cyan | gray | blue | |
2 | black | gray | cyan | gray | blue | |
3 | black | cyan | cyan | gray | cyan | |
4 | black | gray | white | cyan | gray | |
5 | black | cyan | yellow | cyan | blue | |
6 | black | gray | white | blue | gray | |
7 | black | gray | yellow | blue | gray | |
8 | black | gray | white | red | gray | |
9 | black | gray | white | pink | gray | |
10 | black | gray | white | yellow | gray | |
11 | black | gray | white | red | blue | |
12 | blue | gray | cyan | gray | black | |
13 | blue | gray | yellow | gray | black | |
14 | blue | gray | white | gray | black | |
15 | blue | gray | white | magenta | black | |
16 | blue | gray | white | red | black | |
17 | blue | gray | white | cyan | black | |
18 | blue | yellow | white | yellow | black | |
19 | blue | gray | white | magenta | gray | |
20 | blue | gray | white | red | gray | |
21 | gray | blue | black | blue | black | |
22 | gray | red | black | red | black | |
23 | gray | magenta | black | magenta | black | |
24 | gray | blue | black | cyan | blue | |
25 | gray | cyan | black | cyan | black | |
26 | red | gray | white | gray | black | |
27 | red | gray | black | gray | black | |
28 | pink | gray | white | gray | black | |
29 | pink | gray | black | gray | black | |
30 | yellow | gray | black | gray | black | |
31 | brown | gray | gray | gray | black | |
32 | background* | border* | foreground* | secondary background* |
black | |
33 | secondary background* |
secondary border* |
foreground* | background* | black | |
* SASCOLOR window element names. |
Example |
Create a menu with five choices represented by icons.
The first row contains two icons, Outline
and Index
. The second row contains two icons, Compare Files
and
Calendar
.
The third row contains a single icon, End
.
Because the CHOICE variable is assigned the value 5 before BLOCK is called, the cursor is positioned on the Compare Files icon when the window opens. When a user makes a selection, the SELECT statement either exits the DO loop or calls another PROGRAM entry. When control returns from the called program, the menu is displayed again.
INIT: choice=5; LOOP: do while(choice ne 0); choice=block('Writers Toolbox', 'Main Menu',6,'Outline','Index', '','','Compare Files', 'Calendar','','', 'End','','','', 1,2,0,0,3,4,0,0,111,0,0,0); select(choice); when(1) call display('outl.scl'); when(2) call display('index.scl'); when(5) call display('compare.scl'); when(6) call display('calend.scl'); when(9) leave LOOP; otherwise do; if (choice<0) then call display('help.scl',choice); end; end; end; call endblock(); return;
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.