its failed again.
this codes produces same error.
------------------------------
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Grids,
StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
OpenDialog1: TOpenDialog;
StringGrid1: TStringGrid;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var
filename:String;
begin
if OpenDialog1.Execute then
begin
filename:=OpenDialog1.FileName;
StringGrid1.LoadFromCSVFile(filename,',',True,0,True);
end;
end;
end.
.....................