Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Misc > old style strin...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 725 of 792
Post > Topic >>

old style strings

by "Richard Engebretson" <eng@[EMAIL PROTECTED] > Mar 7, 2007 at 07:28 PM

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.




 2 Posts in Topic:
old style strings
"Richard Engebretson  2007-03-07 19:28:58 
Re: old style strings
"sickfile" <  2007-03-07 23:25:10 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 1:24:07 CDT 2008.