aFundExtract is a collection of FundDataStruct filled like
FundDataStruct MyFundData;
MyFundData.price = FillItem.Price;
MyFundData.quantity = FillItem.Quantity;
aFundExtract.Add( MyFundData );
(etc...many times with different values)
Do you mean there is no way to modify the content of the collection
using a foreach loop and a structure ? I don't really understand why, as
each MyFundDataTmp would be "the same" as one of the FundDataStruct
items (or maybe just a local copy ?....)
How to make the "local copy" be a reference to the real item ?
Maybe using a class ?
Is there a way to do it with a struct ?
Also, how do you explain that if i replace the structure with a class, i
do not get the error message anymore ?
Thanks a lot,
Cybertof.
In article <MP************************@msnews.microsoft.com >,
sk***@pobox.com says...
It's a confusing error message, but the variable in a foreach loop is
readonly, basically. Even if you *could* do it, it wouldn't change
anything in aFundExtract, because it's a struct - it would only change
the local variable.