Here is a fun little program to learn some old string techniques;
Program StringPlay;
Var
r, s : string;
i, CharNum : longint;
Begin
for i := 1 to 10 do
begin
readln(r); if r = 'quit' then exit;
CharNum := ord(r[1]); writeln('r[1] is ', Charnum);
readln(s); if s = 'quit' then exit;
CharNum := ord(s[1]); writeln('s[1] is ', CharNum);
if r < s then writeln('input not same; r<s');
if r > s then writeln('input not same; r>s');
r := upcase(r); s:= upcase(s);
if r < s then writeln('upcase not same; r<s');
if r > s then writeln('upcase not same; r>s');
writeln(r, ' ', s);
end;{for loop}
end.
I hope I typed that OK. Anyway, old fashioned ASCII combined with old
fashioned Pascal has some nice features. Freepascal extended the
upcase function.
New users and slow learners might find these programming features
interesting.


|