| 123456789101112131415161718192021222324 |
- program t81_upcase;
- { t81 -- UpCase on a CHAR.
- CALC.INC's Clear ends `until Upcase(Ch) in ['Y','N']'. TP3's UpCase is a
- CHAR function here (later versions also accept a string, which stays ENoLib
- until a string implementation exists): 'a'..'z' fold to 'A'..'Z', everything
- else is unchanged. A constant folds at compile time; a variable is compared
- and decremented at run time. }
- var
- c : char;
- begin
- c := 'a';
- writeln (Upcase (c));
- c := 'z';
- writeln (Upcase (c));
- c := 'A';
- writeln (Upcase (c));
- c := '5';
- writeln (Upcase (c));
- writeln (Upcase ('q'));
- if Upcase (c) = '5' then writeln ('same') else writeln ('diff')
- end.
|