'
' Demonstration source file - It does nothing useful, except prove 
' that the AMOS Pro Browser works (at least, some of the time!)
'

Global GL1,GL2#,GL3$

GL2#=GL1
GL3$="String: GL1 + GL2#"
'GL2#=GL2#+1.5 

LTM=3 : Rem LTM is local to the 'main' routine 

_PROC_1
_PROC_2[GL1]
_PROC_3[5]
_PROC_4

End 

LTM2=3 : Rem This is also local the 'main' routine  

Procedure _PROC_1
   Shared LTM
   ' Uses the LTM variable from the 'main' routine
   LTM=5
   
   _PROC_3[4]
   _PROC_4
End Proc


Procedure _PROC_2[NUM]
   GL1=12 : Rem This is the global variable
   LTM=RT+4 : Rem LTM is local (a different var to the one in main and PROC_1) 
End Proc[RT]


Procedure _PROC_3[REC]
   If REC=0
      Print "Finished!"
   Else 
      Print REC
      _PROC_3[REC-1]
   End If 
End Proc


Procedure _PROC_4
   P=12
   
   If P=5 : Rem In this case P=5 is not an assignment  
      P=6
   End If 
   
   Dim AR(P)
   
   Inc AR(3) : Rem The browser will indicate when *any* element of the array changes
   
End Proc




