Task

Create a function that returns the maximum value in a provided set of values,

where the number of values may not be known until run-time.




aList$= "1 15 -5 6 39 1.5 14"
 
maxVal = val(word$(aList$, 1))
token$ = "?"
while token$ <> ""
    index = index + 1
    token$ = word$(aList$, index)
    aVal = val(token$)
    if aVal > maxVal then maxVal = aVal
wend
 
print "maxVal = ";maxVal