If you compare always on object name and do NOT have operation wich need to be done one a number of collected objects in sequence, the collection is not the best datastructure to use: it forces an access like a scan to a table where you really want a seek() - in other languages you would talk about a hash table, offering you direct access to all collected objects. Just like in tables, count matters: looping through 10 objects or records is fast, but the speed difference grows with the # of records/objects compared. Similar to seek() access time is nearly identical/constant, especially if compared with sequential access. Think of Hash access like a Rushmore for memory access ;-)
>I had no idea this "simple" question would generate so many responses :-)
>
>To answer the person why I first get the object reference:
>
>I look through the collection first testing for a match on the object name - it may or may not exist in the collection. I *could* try instead to EVAL() against the collection using TRY/CATCH but that seems kinda clunky (though possibly faster, although the collection in this case is typically small). e.g.
>
>
>
>TRY
> STORE EVAL("THIS.ioCollection." + tcObjectName ) TO loSavedObject
>CATCH
> STORE .NULL. TO loSavedObject
>ENDTRY
>
>And this seemed to work just fine so let's go with that:
>
>><pre>
>>STORE m.tuValue TO EVAL("m.oSavedObject." + m.tcProperty)
>>
>>
>>Of course, it's easier to just pass the object in the first place.
>>
>>Tamar
>
>Thanks all!