• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

Saving & Loading a TStringGrid

How do I do a "SaveToFile" and "LoadFromFile" (or equivalent) of a TStringGrid??
I am using D1.
0
jdthedj
Asked:
jdthedj
1 Solution
 
WaldekCommented:
You must create a descendant of TSringGrid with two additional method SaveToFile and LoadFromFIle. To create Savetofile you must save to textfile fist RowCount and colCount. After this You must save all cells with for i:=0 to col-1
                     for j:=0 to rows-1
                      writeln(f,cells[j,i]);
To load from file You must load first a cols and rows , then You must load data to every cell

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now