Task

Demonstrate a language's methods of:

   variable declaration
   initialization
   assignment
   datatypes
   scope 
   referencing,     and 
   other variable related facilities


! Strings and arrays must be declared.
! Everything else is 8-byte float, READ/WRITE converts
  CHARACTER str="abcdef", str2*345, str3*1E6/"xyz"/
  REAL, PARAMETER :: named_constant = 3.1415
  REAL :: n=2, cols=4, vec(cols), mtx(n, cols)
  DATA vec/2,3,4,5/, mtx/1,2,3.1415,4,  5,6,7,8/
 
  named = ALIAS(alpha, beta, gamma) ! gamma == named(3)
  ALIAS(vec,n, subvec,2) ! share subvec and vec(n...n+1)
  ALIAS(str,3, substr,n) ! share substr and str(3:3+n-1)
 
  a = EXP(b + c)     ! assign/initialze a=1, b=0, c=0
  str = "blahblah"   ! truncate/expand if needed
  beta = "blahblah"  ! illegal
 
  CALL noArguments_noUSE   ! global scope SUBROUTINE
  CALL Arguments_or_USE(a) ! local scope SUBROUTINE
  t = func()               ! local scope FUNCTION
 
SUBROUTINE noArguments_noUSE() ! all global
  vec2 = $ ! 1,2,3,...
END
 
SUBROUTINE Arguments_or_USE(var) ! all local
  USE : vec                      ! use global object
  var = SUM(vec)
  t = TIME()         ! local, static, USEd by func()
END
 
FUNCTION func()                  ! all local
  USE Arguments_or_USE : t       ! use local object
  func = t
END