'---------------------------------------------------------------------------
'                            (c) 2001-2003 MCS
'                           minmax.bas
' This example show the MIN and MAX functions
' These functions only work on WORD arrays at the moment !!!!!
'---------------------------------------------------------------------------
'Dim some variables
Dim Wb As Word , B As Byte
Dim W(10) As Word

'fill the word array with values from 1 to 10
For B = 1 To 10
  W(b) = B
Next

Print "Max number " ; Max(w(1))
Print "Min number " ; Min(w(1))

Dim Idx As Word , M1 As Word
Min(w(1) , M1 , Idx)
Print "Min number " ; M1 ; " index " ; Idx

Max(w(1) , M1 , Idx)
Print "Max number " ; M1 ; " index " ; Idx
End