Thanks Hank, I love it when it makes sense. Jamie -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of hank williams Sent: Friday, January 13, 2006 4:26 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Copying a DataSet
There is no such thing as passing variables by value in flash. Having a language automatically create major system data structures seems fraught with the potential for unintended consequences because of the hierarchical nature of data structures which point to data structures. If you want to make a copy, you need to explicitly make a copy of it. This is not actually so easy if you are not careful. What you really want to do is create a new dataset and set the dataProvider of the new dataset to the dataProvider of the old dataset. This will have the effect of copying everything out of the old dataset into the new one. The reason for this, which is not obvious, is that the dataprovider field is really a "getter" function that copys data (value) rather than copy's pointers or references. Regards Hank On 1/13/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Can I pass a DataSet byVal and not byRef? I want to create a second DataSet > to filter, sort, do some calculations, etc and leave the original DataSet > intact. > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

