;; Sri Ganeshji : Sri Balaji : Sri Pitreshwarji : Sri Durgaji : Sri Venkateshwara

/*
Objective(s)  
- 	This code demonstrates the usage of Variable in Function Scope
-	The Variable value is lost once we quit the Function
-	The Variable is declared and value is set within Function and the same
	is being accessed in a Report invoked from within this Function
*/

[#Menu: Gateway of Tally]

	Add	: Key Item	: Before : @@locQuit	: Function Scope    : F	: CALL		: Simple Var in Func
    
[Function: Simple Var in Func]

    ;;Defining the variable and its type inside the function 
	Variable	: Simple Var	: String

    ;;Set the variable with a value
	01: SET		: Simple Var	: "Variable value set within Function"
    
    ;;Calling a report from the function
	02:	DISPLAY	: SimpleReport

[Report: Simple Report]

	Form	: Simple Report

[Form: Simple Report]

	Parts	: Simple Report

[Part: Simple Report]

	Lines	: Simple Report Info, Simple Report, Simple Report Var Value
	Width	: 60% Page

	[Line: Simple Report Info]

		Fields	: Info Field
		Local	: Field	: Info Field	: Info		: "Example - Simple Variables"
		Local	: Field	: Info Field	: FullWidth	: Yes
		Local	: Field	: Info Field	: Align		: Centre
		Local	: Field	: Info Field	: Border	: Thin Bottom
		Local	: Field	: Info Field	: Style		: Normal Italic

	[Line: Simple Report]

		Fields	: Simple Report
		SpaceTop: 1

		[Field: Simple Report]

			Set As	: "Variable Simple Var is inherited from Function to the called Report."
			Align	: Center
			Lines	: 0
			Width	: 60% Page

	[Line: Simple Report Var Value]

		Fields	: Simple Report
		SpaceTop: 1
		Local	: Field	: Simple Report	: Set As	: ##SimpleVar   ;;;variable display the same value which was set in the function
		Local	: Field	: Simple Report	: Style		: Large Bold
		Local	: Field	: Simple Report	: Align		: Center

;; End-of-File
