Jump to content


Photo

LoadFromTextFile not working compiled with XE2


  • Please log in to reply
1 reply to this topic

#1 CSE

CSE
  • Members
  • 54 posts
  • Location:Germany

Posted 02 July 2013 - 02:31 PM

Hello,

i am using LoadFromTextfile function of TNextGrid to read a none unicode textfile into the grid.

Short time ago i compiled my project first time in XE2 and LoadFromTextFile function stopped working.

I think it has to do with unicode string/char types used in xe2.

I changed the bold lines, and textfile is readed correctly now.

procedure TNxCustomGridControl.LoadFromTextFile(const FileName: WideString;
Separator: WideChar = ','; MultiLineSeparator: WideChar = '|';
StartRow: Integer = 0);
var
b: Byte;
w: Word;
fw: File of WideChar;
f: File of Byte;
fa: File of AnsiChar; //File of Char;
QChar, wc: WideChar;
Ch: AnsiChar; //Char;
QNo: Integer;
Value: WideString;
UnicodeFile, UnicodeBigEndian, AddValue, NewRow, EofF: Boolean;
ColumnIndex, RowIndex, ReadIndex: Integer;
begin

Best regards,
Thomas

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 03 July 2013 - 10:48 AM

Hi,

You are maybe using older version.

Here is a current code:


var
  b: Byte;
  w: Word;
  fw: File of WideChar;
  f: File of Byte;
  fa: File of Char;
  QChar, wc: WideChar;
  Ch: Char;
  QNo: Integer;
  Value: WideString;
  UnicodeFile, UnicodeBigEndian, AddValue, NewRow, EofF: Boolean;
  ColumnIndex, RowIndex, ReadIndex: Integer;
begin

boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users