I often use global variables inside a unit or inside a component, when the
number of parameters in the procedure is starting to increase.... makes the
code easier to read.

Best to avoid them, partly for the risk of duplicating one - and then the
IDE displays the value of one, half your code uses one and the other half
uses the other.  I keep plaguing Borland to atleast include this as a
compiler warning.


----- Original Message -----
From: "Mark Howard" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Thursday, 3 May 2001 09:54
Subject: [DUG]: Best Practice


Hi

Another Newbie question.

What are the pro's and con's of either
passing a parameter to a procedure
versus
setting a global variable that the procedure can read?

Mark


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to