Task

Explain or demonstrate the levels of visibility of function names and labels within the language.



See also

 Variables for levels of scope relating to visibility of program variables
 Scope modifiers for general scope modification facilities


 
Function Master {
	Module Alfa {
		Gosub 100
		Global M=1000
		\\ delta print 1000
		delta
		End
	100	Print Module(Beta)=False
		Print Module(Delta)=True
		Return
	}
	Group Object1 {
		Function Master {
			=M
		}
		Module Final Beta {
			\\ delta print 500
			delta
			alfa()
			Sub alfa()
				Local N=@Kappa(3)
				Global M=N
				\\ delta print 1500
				Delta
				Print This.Master()=1500
				N=@Kappa(6)
				\\ change value of M, not shadow M like Global M
				M<=N
				\\ delta print 9000
				Delta
				Print .Master()=9000
			End Sub
			Function Kappa(K)
				=M*K
			End Function
		}
	}
	Module Global Delta {
		Goto name1
		\\ a remark here
 
	name1:
		Print Module(Alfa)=False
		Print Module(Beta)=False
		Print Module(Delta)=True
		Print M
	}
 
	\\ This is the program
	K=100
	Global M=500
	Alfa
	Object1.Beta
	Print Object1.Master()=500
	Print K=100, M=500
}
Call Master()
\\ No variables exist after the return from Master()
Print Valid(M)=False
 