test.ugl 499 B

12345678910111213141516171819202122
  1. proc main
  2. if print(0)
  3. print(123)
  4. else
  5. print(999)
  6. endif
  7. print(test(777))
  8. print(add(3,4))
  9. endproc
  10. # expects one argument, which has to be removed with the pop function
  11. # procedures always have to ensure to remove their args
  12. # test expects one argument a(1)
  13. proc test
  14. locals 1
  15. a(2, a(1)) # store a(1) in local var a(2)
  16. print(a(2)) # print local var a(2)
  17. print(a(1)) # print argument a(1)
  18. print(a(0)) # print return value a(0) (should be zero)
  19. return(888)
  20. endproc