<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sat, 02 Jul 1988 21:44:57 GMT
From   : cadnetix.COM!cadnetix!rusty@uunet.uu.net (Rusty)
Subject: My request for a lead to Polydata COMPAS (Z-80)

In article <8807011652.AA25089@ucbvax.Berkeley.EDU> PHR00JG@TECHNION.BITNET
("Jacques J. Goldberg") writes:
->Try this with your Pascal system
->
->program tryit(input,output);
->procedure readwrite;
->var nextchar:char;
->begin
->  read(nextchar); if nextchar <> ' ' then readwrite; write(nextchar);
->end;
->begin
->writeln('Type in a sweet word, end with one space');
->readwrite
->end.
->
->What does it do?
->The intention is, store the word typed until a space is met, then write
->it reversed, preceded by a space.
->In fact, it does not work on any of the machines I tried.

Well, as you noted, unless you set input mode to binary (or immediate),
the observation that this program requires a line terminator is not surprising.

However, the reason that the msdos and cpm versions only print the last
character
is because they did not correctly handle recursion.  The return address and
the variable 'nextchar' both got overwritten on the recursion.

So, it only proves that both pascals dont do windo... I mean recursion.

Sorry about that.
Oh, yes, it prints the word backward fine on a Sun 3/50, but since I did
not set
'binary' input mode, I needed a carriage return.
-----
  Rusty Carruth \ Cadnetix \ 5775 Flatiron Pkwy.  \ Boulder CO 80301 \
(303) 444-8075
  'HOME': P.O. Box 461     \ Lafayette, CO 80026   RADIO: N7IKQ
  UUCP:cadnetix!rusty  DOMAIN:rusty@cadnetix.com  PATH?:{uunet,boulder}!cadnetix!rusty


End of INFO-CPM Digest
******************************
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>