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 2 of 23 Topic 717 of 810
Post > Topic >>

Re: read shows surprising results

by Wolf Behrenhoff <NoSpamPleaseButThisIsValid3@[EMAIL PROTECTED] > Feb 16, 2007 at 12:20 PM

Dirk Weber schrieb:
> 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
> ..........
> writeln('Please enter 123 a45b');
> read(n1,z1,z2,n2);
> 
> Running the program resulted in a runtime error.
> 
> The error message was:
> 
> Runtime error 106 at $08048199

Turbo Pascal gives the same error.

My advice:
Never use read for input from keyboard!

If you want to read just one thing, ReadLn can be okay. ReadLn is also
okay if you want to read a string and parse it.

In all other cases use ReadKey.

You need to validate any input in any case, nobody wants a Runtime error.

Wolf
 




 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 Wed Jul 23 16:16:51 CDT 2008.