[Lazarus] Delphi incompatibility - hard cast
oldtimer.tools at gmail.com
Sat Jan 18 03:55:25 CET 2014
Depending on what the Sender is it might work if it can be cast to a
TDBGrid. Can you actually run an application with that cast? What is the
I put a DBGrid and a DBMemo on a form and in the OnShow assigned the
DataSource property of each to a DataSource I had also placed on the form.
Everything worked as expected. Then I changed the assignment to the DBMemo
to the following:
TDBGrid(DBMemo1).DataSource := DataSource1;
Both a syntax check and a build did not throw any errors but if I attempted
to run the application it would error out with an access violation as soon
as it got to the above assignment.
I think that FPC is just catching it at compile time while Delphi is not.
On Fri, Jan 17, 2014 at 8:44 PM, Hans-Peter Diettrich
<DrDiettrich1 at aol.com>wrote:
> Alejandro Gonzalo schrieb:
> In Delphi this will work even if the Sender is not a TdbGrid, as long as
>> it has a DataSource property:
> It only *happens* to work for you in Delphi.
> This hack requires that Sender has a DataSource property in *exactly* the
> same place where it sits in TdbGrid. That's very unlikely for any other
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Lazarus