I am trying to compare several values and return the highest value. I am getting these values from the count property of a list box.Once I get the count from each box i want to pass those counts to an array and determine which array element is the greatest number. Is this the best implimentation for this operation. Is there a better implementation. Any suggestions??
I see nothing wrong with your idea. I have seen various TSL functions for array sorting posted here and elsewhere which you could use (I have a bubble sort routine which works for 1-dimensional arrays). Alternatively, you can just check "on the fly" while iterating through each object's count property:
largestCount = 0;
# use some obj function to get thisCount
if(thisCount > largestCount)
largestCount = thisCount;
"Any sufficiently advanced bug is indistinguishable from a feature." -Bruce Brown