Re: OpenPictureDialog Problems



On 27 Jul 2005 01:25:28 -0700, "alanglloyd@xxxxxxx"
<alanglloyd@xxxxxxx> wrote:

>Run Time Type Information (RTTI) which is used for "as" and "is"
>operators is relatively slow. So once an object has been confirmed to
>be of a particular type, then use a simple typecast on its reference.
>So code ...
>
>begin
> if Sender is TManyShape then
> begin
> fCurrentShape :=TManyShape(Sender);
> FCurrentShape.Invalidate;
> if ssRight in Shift then
> TManyShape(Sender).Tag := RIGHT_BUTTON_DOWN
FCurrentShape.Tag := RIGHT_BUTTON_DOWN

Surely that is more consistent <smirk>

>Even though we have oodles of computing power, let's not waste it with
>loose programming habits <g>.

True, also it makes the code so much cleaner
- also the funny thing is that clean code normally works faster than
obfuscated code

>Alan Lloyd
>

.


Quantcast