[DUG]Scope
Paul A Norman
paul.a.norman at gmail.com
Fri Feb 10 14:20:50 NZDT 2006
Dear John,
I have seen code where someone forgot to put the unit in their second form's
uses clause, and then put DB instead of DBClient. They went around in
circles.
On 10/02/06, Conor Boyd <Conor.Boyd at trimble.co.nz> wrote:
>
> Your assumption is correct.
>
> You'd be passing a reference to the ClientDataSet, not a copy.
>
> Cheers,
>
> C.
>
> -----Original Message-----
> From: John Bird [mailto:johnkbird at paradise.net.nz]
>
> I was also thinking this (passing the dataset) is the cleanest way, I
> hadn't tried it yet as I was uncertain how Delphi handles passing the
> TClientDataSet object behind the scenes eg as a parameter to a procedure
> in form2....as the dataset can be quite large. I assume it passes a
> reference to the dataset not the entire data...however as a relative
> newbie to datasets I know assumptions can bite back....(for instance I
> read up quite a lot on how strings are handled in Delphi before I got
> too heavily into using
> them)
>
> Can someone kindly confirm the cleanest (=efficient and tidy) way to
> pass the dataset to a procedure in another form if not as a parameter to
> the procedure in the other unit. Any in-depth references to how Delphi
> handles these operations and best practices appreciated too - thanks.
>
> -----Original Message-----
> From: Conor Boyd [mailto:Conor.Boyd at trimble.co.nz]
>
> Without seeing more of your code, I think you'd be better if your
> general
> printing routine gets passed a TClientDataSet object which it uses,
> rather
> than ferreting about in a form's innards.
>
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ns3.123.co.nz/pipermail/delphi/attachments/20060210/5556e45a/attachment.html
More information about the Delphi
mailing list