Computing.Net > Forums > Programming > Turbo Pascal

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Turbo Pascal

Reply to Message Icon

Name: Bubbo
Date: October 20, 2003 at 10:41:29 Pacific
OS: win xp pro
CPU/Ram: 1.4Ghz, 1Gb RAM
Comment:

In my last computing lesson our teacher decided he couldn't be bothered to teach us how exactly to use the read/write commands in turbo pascal so he got us to look it up in the help and make a program that will ask you your name, save it to a file then read the file and tell you your name. None of us managed to do this and he wants it done by thursday. Please help.



Sponsored Link
Ads by Google

Response Number 1
Name: Infinite Recursion
Date: October 20, 2003 at 11:31:58 Pacific
Reply:

Here is some basic Pascal IO... just reads and integer, you need to read a string... I'll leave it up to you to change it up...

function ReadInteger : integer ;
var TheInput : integer ;
begin
TheInput := 0 ;
write( 'Please enter an integer: ' ) ;
read( TheInput ) ;
ReadInteger := TheInput ;
end ;


You can find more on files, and various other file Pascal IO here...

http://www.mit.edu/~taoyue/tutorials/pascal/pas2d.html

With this information, construct some source code, try to compile and debug it, then let us know what errors you have...

IR



0

Response Number 2
Name: George
Date: October 21, 2003 at 07:59:32 Pacific
Reply:

Hey Bubbo:

I can't remember where it is, but you should really read "Homework Rant". It makes a very interesting read and has generated a lot of "good" "food for thought!".

But I will give you these hints.

Look up and read on ...
Assign,
rewrite,
close and
variablename : text

George


0

Response Number 3
Name: Infinite Recursion
Date: October 21, 2003 at 08:06:03 Pacific
Reply:

Bubbo,

You definitely need to read the Homework Rant that George mentions. You can find it here:
HOMEWORK RANT .

However, if you still have problems... send us the code that you are working on, state your errors, your attempts at fixing them... and we'll be more able to assist you.

IR


0

Response Number 4
Name: borelli35
Date: October 21, 2003 at 11:05:10 Pacific
Reply:

========================================================
Bubbo,

"...our teacher decided he couldn't be bothered to teach us how exactly to use the read/write commands in turbo pascal so he got us to look it up in the help..."

It sure sounds like you are upset at your teacher here but he may be trying to teach you to learn how to help yourself. A good instructor teaches learning not memorization as most of those on this forum will do as well. If you don't like your instructors approach then you will probably like ours even less because we tend to rib those who post these questions without showing any effort on their part. It's not to be mean but rather to coax them into trying. Repost this with some code that you attempted to put together (it doesn't matter if it looks odd or is wrong or right. This we will NOT make fun of as long as you tried) and we can definitely, abosolutely and without reservations help you out. Best of luck!

borelli35


0

Response Number 5
Name: Bubbo
Date: October 21, 2003 at 12:17:38 Pacific
Reply:

Thanks for the help. After reading the tutorial that IR posted I realised that I had used reset to open the file when I wanted to write to it. It works fine now.


0

Related Posts

See More



Response Number 6
Name: Infinite Recursion
Date: October 21, 2003 at 14:06:48 Pacific
Reply:

Glad it worked out for you Bubbo, thanks for lettings us know.

IR


0

Sponsored Link
Ads by Google
Reply to Message Icon

Inteligent systems PHP Customising Directory...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Turbo Pascal

managing registry in turbo pascal www.computing.net/answers/programming/managing-registry-in-turbo-pascal/10507.html

turbo pascal editor toolbox www.computing.net/answers/programming/turbo-pascal-editor-toolbox/9543.html

Turbo Pascal! www.computing.net/answers/programming/turbo-pascal/33.html