<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt">OK, how about a compiler switch (that can be turned on or off) that SEARCHES for the property (or event if defined in code and not by the Object Inspector)? It shouldn't be so difficult to deal with Sender (or components in a loop) where the exact Type is not known in advance, just the presence of a specific property or Event. If the switch can be turned Off again after the routine, the impact on performance shouldn't be a concern. Greater flexibility and ease of use, especially for newbies (RTTI is difficult and poorly documented) is needed if freepascal/Lazarus is to become universally adopted. <br><br>Can there please be a discussion on this? Thanks!<br><br>A. G.<div id="yiv2493582943"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,
Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"><div id="yiv2493582943yui_3_13_0_ym1_13_1389738587243_9"><span></span></div><div class="yiv2493582943yqt3989408827" id="yiv2493582943yqt54169"><div class="yiv2493582943yahoo_quoted" id="yiv2493582943yui_3_13_0_ym1_13_1389738587243_11" style="display: block;"> <br clear="none"> <br clear="none"> <div class="yiv2493582943yui_3_13_0_ym1_1_1389738587243_228459" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"> <div class="yiv2493582943yui_3_13_0_ym1_1_1389738587243_228460" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"> <div dir="ltr"> <font face="Arial" size="2"> On Thursday, January 30, 2014 3:58 PM, Alejandro Gonzalo <parkingspace26@yahoo.com> wrote:<br clear="none"> </font> </div> <div class="yiv2493582943y_msg_container"><div
id="yiv2493582943"><div><div class="yiv2493582943yui_3_13_0_ym1_1_1389738587243_228462" style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">OK, how about a compiler switch (that can be turned on or off) that SEARCHES for the property (or event if defined in code and not by the Object Inspector)? It shouldn't be so difficult to deal with Sender (or components in a loop) where the exact Type is not known in advance, just the presence of a specific property or Event. If the switch can be turned Off again after the routine, the impact on performance shouldn't be a concern. Greater flexibility and ease of use, especially for newbies (RTTI is difficult and poorly documented) is needed if freepascal/Lazarus is to become universally adopted. <br clear="none"><br clear="none">Can there please be a discussion on this? Thanks!<br
clear="none"><br clear="none">A. G.<br clear="none"><div><span><br clear="none"></span></div><div class="yiv2493582943yqt3134322810" id="yiv2493582943yqt67877"><div class="yiv2493582943yahoo_quoted" style="display:block;"> <br clear="none"> <br clear="none"> <div class="yiv2493582943yui_3_13_0_ym1_1_1389738587243_228464" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"> <div class="yiv2493582943yui_3_13_0_ym1_1_1389738587243_228465" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"> <div dir="ltr"> <font face="Arial" size="2"> On Friday, January 17, 2014 6:22 PM, Hans-Peter Diettrich <DrDiettrich1@aol.com> wrote:<br clear="none"> </font> </div> <div class="yiv2493582943y_msg_container">Alejandro Gonzalo schrieb:<br clear="none">> In Delphi this will work even if the Sender is not a TdbGrid, as long as <br clear="none">>
it has a DataSource property:<br clear="none"><br clear="none">It only *happens* to work for you in Delphi.<div class="yiv2493582943yqt3403128349" id="yiv2493582943yqtfd34367"><br clear="none"><br clear="none">> TdbGrid(Sender).datasource:=myDataSource;</div><br clear="none"><br clear="none">This hack requires that Sender has a DataSource property in *exactly* <br clear="none">the same place where it sits in
TdbGrid. That's very unlikely for any <br clear="none">other class.<br clear="none"><br clear="none">DoDi<div class="yiv2493582943yqt3403128349" id="yiv2493582943yqtfd28671"><br clear="none"><br clear="none"></div><br clear="none"><br clear="none"></div> </div> </div> </div></div> </div></div></div><br clear="none"><br clear="none"></div> </div> </div> </div></div> </div></div></div></div></body></html>