HelpMEDude
Programmer
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.
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.
