Just remember a component is an object is an pointer. When you're passing a component as a "var" parameter you're passing a pointer to it's pointer (double dereference). That's wistful unless your procedure specifically needs to change the pointer itself.
Passing an parameter as "const" or a simple parameter (no const, no var) probably makes little difference to the execution speed of your application. Using/not using "const" would be down to personal preference. -- Cosmin Prund > -----Mesaj original----- > De la: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] În > numele Stewart, James > Trimis: Tuesday, July 01, 2008 6:03 PM > Către: [email protected] > Subiect: Proper way to pass components as parameters? > > This is more of a general question than a question concerning a > problem. > > What do you all consider the best way to pass components (TDataSet, > TTabControl, etc) as parameters to a function or procedure call? > > VAR, CONST, or by Value? Which would give better execution speed or > memory managent? Is one way of passing the parameters better than > another? > > Thanks > > James > > James D. Stewart > Senior Systems Analyst > > Carlson Wagonlit Travel | SatoTravel > 4601 N. Fairfax Drive. Suite 170 > Arlington, VA 22203 > > Email: [EMAIL PROTECTED] > Phone: 703-276-2046 > Fax: 703-276-2052 > > > _______________________________________________ > Delphi mailing list -> [email protected] > http://lists.elists.org/cgi-bin/mailman/listinfo/delphi _______________________________________________ Delphi mailing list -> [email protected] http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

