Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: XE2 Sample proj (shows a text file with a TDataSet) not working with XE10


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Jan 30, 2018 2:27 PM Last Post By: NCR User
NCR User

Posts: 2
Registered: 11/29/02
XE2 Sample proj (shows a text file with a TDataSet) not working with XE10  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 25, 2018 6:48 AM
Hello Friends,

I have a simple project TextData taken from the Delphi XE2 Samples directory.
It shows a text file content in a DBGrid deriving a component from TDataSet.

It works fine in Delphi XE2 :
https://www.dropbox.com/s/g2bcbh2h82pzs8h/TextData_XE2.zip?dl=0 (also exe and txt files are included)

It compiles but shows only spaces in the DBGrig using Delphi XE10:
https://www.dropbox.com/s/eh39oc9jo7kn0cx/TextData_XE10.zip?dl=0 (also exe and txt files are included)

I've seen that the function TTextDataSet.GetFieldData is never called.
I can't understand why.

Any idea?

Thanks in advance.
Regards
S.

Edited by: NCR User on Jan 25, 2018 6:49 AM

Edited by: NCR User on Jan 25, 2018 7:41 AM
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: XE2 Sample proj (shows a text file with a TDataSet) not working with XE10 [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 25, 2018 1:14 PM   in response to: NCR User in response to: NCR User
On 1/25/2018 10:42 AM, NCR User wrote:
Hello Friends,

I have a simple project TextData taken from the Delphi XE2 Samples directory.
It shows a text file content in a DBGrid deriving a component from TDataSet.

It works fine in Delphi XE2 :
https://www.dropbox.com/s/g2bcbh2h82pzs8h/TextData_XE2.zip?dl=0 (also exe and txt files are included)

It compiles but shows only spaces in the DBGrig using Delphi XE10:
https://www.dropbox.com/s/eh39oc9jo7kn0cx/TextData_XE10.zip?dl=0 (also exe and txt files are included)

I've seen that the function TTextDataSet.GetFieldData is never called.
I can't understand why.

Any idea?

Thanks in advance.
Regards
S.

Edited by: NCR User on Jan 25, 2018 6:49 AM

Edited by: NCR User on Jan 25, 2018 7:41 AM

you are overridding hte wrong function. You should be overriding

function GetFieldData(Field: TField; var Buffer: TValueBuffer): Boolean;
override;

Just fix up the signatures and it works for Me in RAD Studio 10 Seattle. Note
there is not an XE10 version of RAD Studio. There is a 10 Seattle, 10.1 Berlin
and 10.2 Tokyo. The last XE version was XE8.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

NCR User

Posts: 2
Registered: 11/29/02
Re: XE2 Sample proj (shows a text file with a TDataSet) not working with XE10 [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 30, 2018 2:27 PM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
It Works !!
Thank you soooooooooooooooo much !
:)

Jeff Overcash (TeamB) wrote:
On 1/25/2018 10:42 AM, NCR User wrote:
Hello Friends,

I have a simple project TextData taken from the Delphi XE2 Samples directory.
It shows a text file content in a DBGrid deriving a component from TDataSet.

It works fine in Delphi XE2 :
https://www.dropbox.com/s/g2bcbh2h82pzs8h/TextData_XE2.zip?dl=0 (also exe and txt files are included)

It compiles but shows only spaces in the DBGrig using Delphi XE10:
https://www.dropbox.com/s/eh39oc9jo7kn0cx/TextData_XE10.zip?dl=0 (also exe and txt files are included)

I've seen that the function TTextDataSet.GetFieldData is never called.
I can't understand why.

Any idea?

Thanks in advance.
Regards
S.

Edited by: NCR User on Jan 25, 2018 6:49 AM

Edited by: NCR User on Jan 25, 2018 7:41 AM

you are overridding hte wrong function. You should be overriding

function GetFieldData(Field: TField; var Buffer: TValueBuffer): Boolean;
override;

Just fix up the signatures and it works for Me in RAD Studio 10 Seattle. Note
there is not an XE10 version of RAD Studio. There is a 10 Seattle, 10.1 Berlin
and 10.2 Tokyo. The last XE version was XE8.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02