Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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.

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

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 : textGeorge

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

========================================================
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

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.

![]() |
Inteligent systems
|
PHP Customising Directory...
|

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