Documente Academic
Documente Profesional
Documente Cultură
Rick Aster
Introduction
An SCL program, like any computer program, consists only of text. Programmers looking for a way to reinforce the meaning and structure of a program are usually limited to spacing and comments. For example, to make the sections of a program easier to find, you can place blank lines between them. In the case of an SCL program, the Source window of SAS/AF software also lets you add color and video attributes to selected text of the program. Using color, in particular, can enhance the visual impact of the structure of an SCL program. This paper introduces a color scheme that can be used on SCL programs. This color scheme is generally useful for SCL programs of all kinds. It is also meant as an example of the possibility of using color to reinforce SCL program text. This paper also describes the process of applying color in the Source window, which is the same regardless of the specific color scheme you use.
Text colors on white background Contrast Visibility K BLACK + B BLUE + G GREEN + R RED + C CYAN M MAGENTA A GRAY Text colors on black background Contrast Visibility W WHITE + + Y YELLOW + + M MAGENTA C CYAN A GRAY R RED G GREEN
Readability
+ Readability
Color
The Source window displays text against a background of either white or black. You can choose any of the available SAS colors for the color of any part of the text that makes up the SCL program. These are qualities to consider in selecting colors:
+ +
Contrast. A text color must be different enough in brightness to stand out from the background. Yellow text on a white background or blue text on a black background may not always provide enough contrast to be usable. Visibility. Some colors are more visible, meaning the reader notices them more quickly. Use high-visibility colors to call attention to key points in the structure of the program. Readability. Speed, comprehension, and ease of reading are the main factors of readability. Use highly readable colors for most of the text that makes up the program. It is perfectly okay to use low-readability colors for single words, short phrases, or repeated text, but they can cause reader fatigue if you use them for blocks of text.
The following tables rate selected SAS colors for contrast, visibility, and readability. You can identify a SAS color by name or one-letter code, as shown. The appearance and effects of color vary according to operating system and display hardware, so what you see on your screen may be slightly different.
Video Attributes
Along with color, SAS software lets you apply video attributes to text. The most useful video attribute is reverse video (R), which swaps the text color and background color for the selected text. When applied to a line of text, reverse video lends high visibility with no loss of readability. Another video attribute, underline (U), may occasionally be useful, but is not supported by all operating systems and display hardware. The two other video attributes are not recommended for use in programs blinking (B) because it is distracting, and highlighting (H) because it is not widely supported.
either of these forms of the COLOR command: COLOR MTEXT color COLOR MTEXT color video attribute The command changes the color and, optionally, applies a video attribute to the selected text. For example, the command COLOR MTEXT G makes the selected text green. The command COLOR MTEXT RED R applies the color red and the reverse video attribute to the selection, so that the background is red and the text is the usual background color. After you use the COLOR command, the colors you apply are stored with the text of the SCL program the next time you save the entry that contains the program. Issuing the COLOR command You can issue the COLOR command simply by entering it in the command line. Applying a color scheme to a program requires you to issue the same commands repeatedly, with different text selected each time. One shortcut is to recall previously typed COLOR commands using the command-line menu feature of the display manager GUI interface. Another alternative is to assign the various COLOR commands to function keys in the Keys window and use the function keys to issue the commands.
Statement labels of subroutines and references to statement labels: RED Debugging statements: RED To achieve a similar effect on a BLACK background, substitute WHITE for BLACK, CYAN for BLUE, and YELLOW for RED.
Objectives
In designing a color scheme, the author considered these primary objectives. Differentiate SCL statements from submitted statements. Visually identify comments. Call attention to the high-level outline and control flow of the program. The color scheme applies a high-visibility color and reverse video for the reserved statement labels and screen variable statement labels that mark the beginning of program phases. It uses separate colors for SCL statements, comments, and submitted statements (using three colors of good readability). A low-visibility color is used to avert attention from statements that are commented out, while a high-visibility color is applied to debugging statements so they do not go forgotten when debugging is complete.
References
SAS and SAS/AF are registered trademarks of SAS Institute Inc. 1998 Rick Aster Contact: Rick Aster Breakfast Communications Corporation P.O. Box 176 Paoli, PA 19301-0176 finis@pond.com http://www.pond.com/~finis/sas