TIP: Click on subject to list as thread! ANSI
echo: delphi
to: FRANCOIS PIETTE
from: LOUIS RIZZUTO
date: 1997-05-28 03:01:00
subject: Re: Some questions about Delphi

*** Quoting Francois Piette from a message to Louis Rizzuto ***
  LR> I do not understand the often
Dangerous stuff this type casting IMHO.  It bypasses 'strong typing' and this 
can and does create ahvoc on projects involving many programmers - or even 
one programmer like me that works on on project over many man-years.  Hmmm, 
it sort of reminds of old times where programmers did - ahwm - unusual stuff 
to gain job security and drive managers to terrifying heights of dispair.  
Did I contribute to that?  :) Naw.  I am too straight.  But I am learning - 
remembering - something important here, me thinks.
Um, that was in response to:
  LR> I understand this concept of 'safe'. 
FP> Typecasting is use to tell the compiler to consider a variable of a 
FP> given datatype to be like a variable with another datatype.
FP> For example: A TList object maintain a list of pointer to other  
FP> objects. But you need simple integers in this list, not pointers.  
FP> Knowing that an integer has the same size as a pointer, you can  
FP> typecast the integer to a pointer type when you put the integer into  
FP> the list and typecast it back to an integer when you retrieve the  
FP> element.
FP> var     SomeIntegerVariable : Integer     MyList : TList;
FP> begin     MyList.Add(PChar(SomeIntegerVariable)); ... ...     
FP> SomeIntegerVariable := Integer(MyList.Last); ... end;
Sorry about that, this quoting system is hard to remember and use.
  LR> I do not understand the often
  LR> used parameter (Sender : TObject) and why it is used in 
FP> virtually
  LR> every piece of procedure code I have seen thus far. It's 
FP> significance
  LR> eludes me still.
FP> Every (or nearly) all event handler procedure takes as first 
FP> parameter  the well known Sender : TObjet. This allow to have the 
Thnaks for that help Francois.  I will study it.  
 
Regards, -= Lou =-
--- Telegard v3.02/mL
---------------
* Origin: * Toon Town USA * Beacon,NY * 914-838-3073 * (1:2624/505)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.