MrLobster
08-05-2004, 04:45 AM
How can i save this dynamic record array quickly in delphi?
type
tSinglePlayer = record
Name : string;
Numbers : array of integer;
end;
tPlayer : array of tSinglePlayer
tDatabase = record
Player : tPlayer;
end;
var
Database : tDatabase;
I previously used to use a simple piece of code to export the main database record.
var
DatabaseFile : file of tDatabase;
begin
AssignFile(DatabaseFile, 'database.txt');
Rewrite(DatabaseFile);
writeln(DatabaseFile, Database);
reset(DatabaseFile);
end;
However now that i have moved from static arrays to dynamic arrays, i get an error stating that 'tGame' needs finalization - not allowed in file type.
NOTE: there is a lot more record types for each player than above and there could be up too 100,000 players...
check out my game PAOL to see why, www.fresh-lobster.tk
type
tSinglePlayer = record
Name : string;
Numbers : array of integer;
end;
tPlayer : array of tSinglePlayer
tDatabase = record
Player : tPlayer;
end;
var
Database : tDatabase;
I previously used to use a simple piece of code to export the main database record.
var
DatabaseFile : file of tDatabase;
begin
AssignFile(DatabaseFile, 'database.txt');
Rewrite(DatabaseFile);
writeln(DatabaseFile, Database);
reset(DatabaseFile);
end;
However now that i have moved from static arrays to dynamic arrays, i get an error stating that 'tGame' needs finalization - not allowed in file type.
NOTE: there is a lot more record types for each player than above and there could be up too 100,000 players...
check out my game PAOL to see why, www.fresh-lobster.tk