Talk About Network

Google


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 > Re: read shows ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 16 of 23 Topic 717 of 818
Post > Topic >>

Re: read shows surprising results

by Waldek Hebisch <hebisch@[EMAIL PROTECTED] > Feb 16, 2007 at 11:19 PM

Dirk Weber <dirk-weber@[EMAIL PROTECTED]
> wrote:
> Hi,
> 
> I do not really understand where the mistake is: In my understanding of
> the read statement or in the book I use for self studying Pascal.
> 
> Here the program listing
> ..........
> 
> program selbsttest_s_25;
> uses crt;
> 
> var
> z1,z2:char;
> n1,n2:integer;
> 
> const
> cz1='z1';
> cz2='z2';
> cn1='n1';
> cn2='n2';
> 
> BEGIN
> clrscr;
> 
> writeln('Cooper/Clancy, Pascal, Braunschweig 1991, p. 25, Selbsttest');
> 
> z1:=' ';
> z2:=' ';
> n1:=0;
> n2:=0;
> 
> writeln('Please enter 123 a45b');
> read(n1,z1,z2,n2);
> writeln(z1:5,z2:5,n1:5,n2:5);
> writeln;
> END.
> ................
> 
> My problem
> 
> According to Cooper/Clancy the variables should have the following
> contents:
> 
> z1: A blank
> z2: 'A'
> n1: 123
> n2: 45
> 

FYI, GNU Pascal gives the expected result (of course with lowercase
'a').

-- 
                              Waldek Hebisch
hebisch@[EMAIL PROTECTED]

 




 23 Posts in Topic:
read shows surprising results
Dirk Weber <dirk-weber  2007-02-16 08:34:29 
Re: read shows surprising results
Wolf Behrenhoff <NoSpa  2007-02-16 12:20:28 
Re: read shows surprising results
Marco van de Voort <ma  2007-02-16 12:05:55 
Re: read shows surprising results
"Richard Engebretson  2007-02-16 05:55:58 
Re: read shows surprising results
dirk-weber@[EMAIL PROTECT  2007-02-17 07:12:00 
Re: read shows surprising results
Marco van de Voort <ma  2007-02-17 12:35:24 
Re: read shows surprising results
"Richard Engebretson  2007-02-17 05:00:23 
Re: read shows surprising results
CBFalconer <cbfalconer  2007-02-17 08:18:02 
Re: read shows surprising results
CBFalconer <cbfalconer  2007-02-17 09:26:48 
Re: read shows surprising results
dirk-weber@[EMAIL PROTECT  2007-02-18 11:00:00 
Re: read shows surprising results
CBFalconer <cbfalconer  2007-02-16 10:52:46 
Re: read shows surprising results
John Reagan <john.reag  2007-02-16 18:54:37 
Re: read shows surprising results
dirk-weber@[EMAIL PROTECT  2007-02-17 07:19:00 
Re: read shows surprising results
"Richard Engebretson  2007-02-16 13:10:03 
Re: read shows surprising results
"Richard Engebretson  2007-02-16 13:42:11 
Re: read shows surprising results
Waldek Hebisch <hebisc  2007-02-16 23:19:19 
Re: read shows surprising results
dirk-weber@[EMAIL PROTECT  2007-02-17 07:25:00 
Re: read shows surprising results
dirk-weber@[EMAIL PROTECT  2007-02-17 07:22:00 
Re: read shows surprising results
Marco van de Voort <ma  2007-02-17 12:29:16 
Re: read shows surprising results
dirk-weber@[EMAIL PROTECT  2007-02-17 07:04:00 
Re: read shows surprising results
dirk-weber@[EMAIL PROTECT  2007-02-17 07:17:00 
Re: read shows surprising results
dirk-weber@[EMAIL PROTECT  2007-02-18 11:02:00 
Re: read shows surprising results
CBFalconer <cbfalconer  2007-02-18 10:06:11 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Sat Oct 11 3:26:15 CDT 2008.