cs_ahmed12
Messages postés83Date d'inscriptionlundi 5 mai 2003StatutMembreDernière intervention 9 décembre 2010
-
5 oct. 2003 à 16:27
cs_ahmed12
Messages postés83Date d'inscriptionlundi 5 mai 2003StatutMembreDernière intervention 9 décembre 2010
-
11 oct. 2003 à 14:01
oubadj
Salut tout le mande
Je veux savoir comment j’ ouvrir le contenue d’un fichier texte dans un TstringGrid Ling par ling. Comme avec le memo , j’ai essaie ce source mais j’ai pas arriver
A voire le texte de fichier merci d’avance.
procedure TForm1.Button1Click(Sender: TObject);
var
c, r : integer;
F:textfile;
lig:string;
begin
if opendialog1.execute then
assignfile(F,opendialog1.filename);
reset(F);
with StringGrid1 do
begin
// entêtes
for c := 0 to ColCount-1 do
Cells[c,0] := 'Col ' + IntToStr(c);
// données
for r := 1 to RowCount-1 do
begin
Cells[0,r] := IntToStr(r);
for c := 1 to ColCount-1 do
while not eof(F) do
begin
readln(F,lig);
Cells[c,r] := lig;