Hi Paul,
It's known problem. See
Re: For Each rotation changes type in collection Thread #
843966 Message #
844014>I've run into a weird situation with objects being added to a collection and using AMEMBERS with it. Here's some sample code which shows the problem:
>
>
>LOCAL loCollection
>?"-------------------"
>loCollection = CREATEOBJECT("Collection")
>loItem = CREATEOBJECT("Empty")
>ADDPROPERTY(loItem, "TestProp", "Test")
>?AMEMBERS(laTest, loItem)
>
>loCollection.Add(loItem)
>
>FOR EACH loCollItem IN loCollection
> ? "This fails:"
> ?AMEMBERS(laCollTest, loCollItem)
> ?
> ? "This works:"
> ?loCollItem.TestProp
> ?AMEMBERS(laCollTest, loCollItem)
>ENDFOR
>
>
>Basically, what I'm seeing is that until I actually access a property in the item in the collection, AMEMBERS doesn't see any of the properties. So, on the "This fails:" line I'm seeing a count of 0 (it should be 1), and once I access the property, it returns 1.
>
>What's up with this?
--sb--