o.add(m.oRec)
otherwise reinserting into the source cursor is super easy:select alias for i = 1 to m.oColl.count oRec = m.oColl.item(m.i) if seek(m.oColl.getKey(m.i), 'alias', 'primaryKey') gather from name oRec else insert into alias from name oRec endif endfor>Nice. I had not used a collection object before. I would not have a primary key at the point of passing back the data (I would probably assign that key when I inserted it into the view in the calling form). Reading the help file, it seems as though you don't have to assign a key - any reason to do assign the key at the time of adding the object to the collection (ease of use later or good design?).
>>procedure form.unload >> >>o = create('collection') >>local oRec as Empty >>select ... >>scan >> scatter name oRec memo >> o.add(m.oRec, transform(primaryKey)) >>endscan >> >>return m.o >>