On Mar 8, 4:28 am, "Richard Engebretson" <e...@[EMAIL PROTECTED]
> wrote:
> 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 fa****oned ASCII combined with old
> fa****oned Pascal has some nice features. Freepascal extended the
> upcase function.
>
> New users and slow learners might find these programming features
> interesting.
Good. We can change line 15 (r := upcase(r); s:= upcase(s);) to:
for CharNum := 1 to length (r) do r[CharNum] := upcase
(r[CharNum]);
for CharNum := 1 to length (s) do s[CharNum] := upcase
(s[CharNum]);
Makes it work in Turbo Pascal.


|