nem spørgsmål
mit program skal hente en *.dat fil ind i stringgridden men der står kun nuller i cells[3,i]hvordan kan jeg læse de korrekte tal ind?
og evt slette filen automatisk derefter
procedure TDogB.LaesOrdre;
var
Ordrefil : file of TOrdre;
FOrdre: TOrdre;
i:byte;
dag:integer;
begin
if findfirst(\'k:\\test\\grossist2\\ordre\\*.dat\', $00000020, sr)=0 then
begin
Assignfile(Ordrefil,\'k:\\test\\grossist2\\ordre\\\'+sr.name+\'\');
showmessage(sr.name);
try
Reset (Ordrefil);
while not eof(Ordrefil) do
begin
read(Ordrefil,FOrdre);
for i:=1 to 10 do
begin
case fOrdre.Ordrelinie[I].Varenr of
1: sgsalg.cells[3,1]:= inttostr(fOrdre.Ordrelinie[I].antal);
2: sgsalg.cells[3,2]:= inttostr(fOrdre.Ordrelinie[I].antal);
3: sgsalg.cells[3,3]:= inttostr(fOrdre.Ordrelinie[I].antal);
4: sgsalg.cells[3,4]:= inttostr(fOrdre.Ordrelinie[I].antal);
5: sgsalg.cells[3,5]:= inttostr(fOrdre.Ordrelinie[I].antal);
6: sgsalg.cells[3,6]:= inttostr(fOrdre.Ordrelinie[I].antal);
7: sgsalg.cells[3,7]:= inttostr(fOrdre.Ordrelinie[I].antal);
8: sgsalg.cells[3,8]:= inttostr(fOrdre.Ordrelinie[I].antal);
9: sgsalg.cells[3,9]:= inttostr(fOrdre.Ordrelinie[I].antal);
10: sgsalg.cells[3,10]:= inttostr(fOrdre.Ordrelinie[I].antal);
end;
end;
end;
finally
Closefile(Ordrefil);
end;
end;
end;
