Clean up after you!
From: Geir Baardsen (geir_baardsen_at_hotmail.com)
Date: 08/29/04
- Next message: Maarten Wiltink: "Re: TStringgrid - autocalculate"
- Previous message: Geir Baardsen: "Re: TStringgrid - autocalculate"
- Next in thread: Maarten Wiltink: "Re: Clean up after you!"
- Reply: Maarten Wiltink: "Re: Clean up after you!"
- Reply: Tom de Neef: "Re: Clean up after you!"
- Reply: Ekkehard Domning: "Re: Clean up after you!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Aug 2004 09:03:55 -0700
Hi!
Can anybody tell me if I'm doing the following in a wrong way?
What I do is have a textfile loaded into a stringgrid by the help
of an OpenDialog
(it works fine, but am I cleaning up after me?,
Do I need to free the OpenDialog1?):
procedure TfrmTimeList.btnOpenFileClick(Sender: TObject);
var
MyFile : TextFile;
begin
try
if OpenDialog1.Execute then
begin
AssignFile(MyFile, OpenDialog1.FileName);
try
LoadGrid(grTimeList,OpenDialog1.FileName);
with grTimeList do
begin
FixedColor := clBtnFace;
EditorMode := false;
ColCount := 5;
RowCount := 32;
ColWidths[1] := 200;
ColWidths[2] := 50;
ColWidths[3] := 200;
ColWidths[4] := 50;
end;
except
on E:EInOutError do
ShowMessage(E.Message);
end;
end;
finally
CloseFile(MyFile);
end;
end;
:-)
- Next message: Maarten Wiltink: "Re: TStringgrid - autocalculate"
- Previous message: Geir Baardsen: "Re: TStringgrid - autocalculate"
- Next in thread: Maarten Wiltink: "Re: Clean up after you!"
- Reply: Maarten Wiltink: "Re: Clean up after you!"
- Reply: Tom de Neef: "Re: Clean up after you!"
- Reply: Ekkehard Domning: "Re: Clean up after you!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]