; =================================
 ; Passing Arrays
 ; =================================
  
; Create some Test arrays for this example  
  Dim Table(0)
  Dim RandomStuff(0)


; Call the Fill Array function, passing it the TABLE() array to 
; to do it's work on
  FillArrayWithRandoms(Table(),10)
  
; Call the Fill Array function, passing it the RANDOMSTUFF() array to 
; to do it's work on
  FillArrayWithRandoms(RandomStuff(),20)

; Use Print Array function to Display the Contents of the previous arrays

  Print "Display the Contents of TABLE() Array"
  PrintArray Table()
 
  Print "Display the Contents of RandomStuff() Array"
  PrintArray RandomStuff()

; Show the user the screena dn wait for a key press before ending
  sync
  waitkey
  

; Define our array which will Dimension and then randomly fill the
; passed array with random values
Function FillArrayWithRandoms(ME(),Size)
  Dim Me(Size)
   For lp=0 to Size
       Me(lp)=Rnd(1000)
   next
EndFunction

Function PrintArray(ME())
   For lp=0 to getarrayelements(me(),1)
      print Digits$(lp,2)+" ="+str$(Me(lp))
   next
EndFunction