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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Any type or record to file or stream or string?

Status
Not open for further replies.

HelpMEDude

Programmer
Feb 27, 2005
21
SE
Hello everybody!

I have created a record, that contains a couple of integers, classes, strings, and some additional own made types.

I want to be able to save all the values, to save the whole data type to the disk. Is that possible?, I would prefer a way that is fast for the program.

Of course the idea is that the program should be able to read it again and then use the record as if nothing has changed.

I'm not a experienced pointer user but I tried doing this:

var
a:^ansistring;
begin
a:=@myrecord;
strtofile(^a);
end;


But it doesn't work that well. I think it doesn't know where the string terminates.

Well. Is there any easy way to turn data types to pure data and then saving it?

Of course I can't say I'm to satisfied if I have to make a procedure that writes every entry in the record by hand to a file. And then another procedure to open the file and putting every value back by hand.

Any help would be appreciated.
happy.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top