
  '-----------------------
  function fun() as string
  '=======================

  dim as long a=42, b=42

  gosub routine1 'or call routine1
  function = "a=" a ",  b=" b
  exit function

  routine1:
  '--------
  '
  scope           'ALLOWS SUBROUTINE TO CREATE ITS OWN PRIVATE VARIABLES
    dim as long a 'THIS CANNOT BE ACCESSED BY THE MAIN FUNCTION
    a=7           'SIMILAR TO A COCAL VARIABLE 
    b=7           '
  end scope               '
  ret             'USE 'RET' NOT RETURN (interpreted as a C style return)
  '
  end function

  '====
  'MAIN
  '====

  print fun() 'RESULT: a=42, b=7 