Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write to files, read file into array

Status
Not open for further replies.

nemesisrobot

Programmer
May 28, 2005
5
GB
Hi. I was proficient at Pascal about a year ago, and now I need to go back to pascal, a friend needs a program written.

I know how to do most of it, it's just I need some clarification on how to read a files contents into an array (each array position is made up of a record, for instance array.name, array.age etc.

As well as reading from files into an array, how do I then update the file with the array at the end of program use?

Thanks in advance
 
It depends on what kind of file you're talking about. If it's a typed file, all it takes is reading the record type into the array entry and then incrementing the index. If it's a text file, it'll be a bit tougher.

Pascal handles record types the same as it does individual types.
 
It is a .dat file

Sorry to be a pain, but any chance of sample code for reading/writing? Cheers
 
Not anything you would like, so I would say likely no, because it's a simple thing you can find in your books and what-not and another good reason being you didn't give anyone enough information to even bother trying to write it for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top