> lo_collection = NEWOBJECT('Collection') > lo_Collection.Add('item','key') > ? lo_collection.Item('key') && Prints 'item' > lo_collection.Item('key') = "Newitem" >>this last line gives error message "Function argument value, type, or count is invalid." Is there a different way to change the collection key's value?
Ex. loCol.Update('key','Newitem') define class mycollection as Collection procedure Update lparameters teKey, tuvalue do case case vartype(teKey) = 'C' local lnpos lnpos = THIS.GetKey(teKey) if lnpos <> 0 then THIS.Remove(teKey) THIS.Add(tuvalue,,lnpos) endif case vartype(tekey) $ 'YNIB' if teKey >= 1 and teKey <= THIS.Count then THIS.Remove(teKey) THIS.Add(tuvalue,,teKey) endif otherwise * what were you thinking; don't do anything endcase endproc enddefineHTH.