home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast.iso
/
pcmag
/
vol6n20.zip
/
FIGURES.ZIP
/
FIGURE.5
< prev
next >
Wrap
Text File
|
1987-10-16
|
1KB
|
38 lines
(* This case statement lists all the case labels
in numeric order. There is no overlap -- a
given character matches one and only one case.
If MyChar is an ordinary alphanumeric character,
the program will make 10 comparisons before
matching it. SLOWER!*)
CASE Ord(MyChar) OF
0..7 : Do_Control_Char;
8 : Do_Backspace;
9 : Do_Tab;
10 : Do_LF;
11,12 : Do_Control_Char;
13 : Do_CR;
14..26 : Do_Control_Char;
27 : Do_Escape;
28..31 : Do_Control_Char;
32..127 : Do_Lower_ASCII;
ELSE Do_Upper_ASCII;
END;
(* This case statement lists its labels in
order from most often used to least. If
MyChar is alphanumeric, only one comparison
will be required. Also, by letting the
special control characters overlap the general
case for control characters, it reduces the
total number of labels required. FASTER!*)
CASE Ord(MyChar) OF
32..127 : Do_Lower_ASCII; {Most frequent first}
10 : Do_LF;
13 : Do_CR;
8 : Do_Backspace;
9 : Do_Tab;
27 : Do_Escape;
0..31 : Do_Control_Char; {Overlaps}
ELSE Do_Upper_ASCII;
END;