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.




1000 DEF FINDMAX(REF ARR)
1010   LET MX=ARR(LBOUND(ARR))
1020   FOR I=LBOUND(ARR)+1 TO UBOUND(ARR)
1030     LET MX=MAX(MX,ARR(I))
1040   NEXT
1050   LET FINDMAX=MX
1060 END DEF