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.




FUNCTION PBMAIN()
    DIM x AS LONG, y AS LONG, z AS LONG
    RANDOMIZE TIMER
 
    FOR x = 1 TO 10
        y = INT(RND * 10000)
        z = MAX(y, z)
    NEXT
 
    ? STR$(z) & " was the highest value"
END FUNCTION