Topic: Get Bug " TableGrid1.LoadFromTextFile() "

TableGrid1.LoadFromTextFile Not Effect in MVD 5.2

procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
opendialog : Topendialog ;
begin
opendialog := Topendialog.Create(Form1);
IF opendialog.execute then
begin
Form1.TableGrid1.LoadFromTextFile(opendialog.Filename) ;
Form1.Memo1.Lines.LoadFromFile(opendialog.Filename) ;
end;
Form1.TableGrid1.BestFitColumns(bfboth);
opendialog.Free ;
end;
begin
end.
Post's attachments

Attachment icon ImportTool.zip 62.42 kb, 320 downloads since 2019-02-28 

My Visual Database : I Love You
Easy For Beginner Student For Me

Re: Get Bug " TableGrid1.LoadFromTextFile() "

File should be Unicode (UCS-2 Little Endian)

Dmitry.

Re: Get Bug " TableGrid1.LoadFromTextFile() "

help me please !
Can  import support UTF8,UTF16 ?

My Visual Database : I Love You
Easy For Beginner Student For Me

Re: Get Bug " TableGrid1.LoadFromTextFile() "

Hello prahousefamily

In a program done with MVD, I import a text file :

procedure ToDo_OnShow (Sender: TObject; Action: string);
Var mytext: tstringlist;
begin
     mytext := TStringList.Create;
     mytext.LoadFromFileAnsi('ToDo.txt');
     ToDo.Memo1.text := mytext.text;
     mytext.Free;
end;

Can this help you ?
Regards
JB

Re: Get Bug " TableGrid1.LoadFromTextFile() "

Thank You jean.brezhonek I try  Code  and result

Now i try convert encode city.text by navicode  OK  Can Import To  city.text

But
I try  code Tstringlist and show Form.caption := Tstringlist[0] Error Message Out OF bound  How To Fix ???

https://i.ibb.co/ZW392d9/2019-03-01-007.png

Help ME Please !

My Visual Database : I Love You
Easy For Beginner Student For Me

Re: Get Bug " TableGrid1.LoadFromTextFile() "

Please attach your project, project in the first message don't have script file.

Dmitry.

7 (edited by prahousefamily 2019-03-01 15:16:30)

Re: Get Bug " TableGrid1.LoadFromTextFile() "

DriveSoft Today 17:53:43

Please attach your project, project in the first message don't have script file.

MVD 2.8
https://i.ibb.co/r78J0BR/Image-002.png
MVD 3.6
https://i.ibb.co/jVfHkqs/Image-003.png
MVD 4.6
https://i.ibb.co/vQ9895x/Image-004.png
MVD 5.2
https://i.ibb.co/XxgN5Np/Image-005.png

Help Me please !

Post's attachments

Attachment icon ImportTool.zip 77.15 kb, 292 downloads since 2019-03-01 

My Visual Database : I Love You
Easy For Beginner Student For Me

Re: Get Bug " TableGrid1.LoadFromTextFile() "

Please use

sl.LoadFromFileAnsi(opendialog.Filename); 

instead

sl.loadfromfile(opendialog.Filename) ; 
Dmitry.