Updating parameters in a procedure / function
- Posted by ZNorQ <znorq at holhaug.com> Jul 14, 2006
- 581 views
I want to create a function that adds an element to a sequence, and returns the index in the sequence. I want it to be flexible, so that it can update any sequence - but how do I do that? For example;
atom idx idx = 0 sequence myCars myCars = {} sequence myPhones myPhones = {} sequence myGirlFriends myGirlFriends = {} function addElement(sequence Element, sequence mySequence) mySequence = append(mySequence, Element) return length(mySequence) end function idx = addElement("Audi", myCars) idx = addElement("99 99 99 99", myPhones) idx = addElement("Trine", myGirlFriends)
Regards, Kenneth / ZNorQ