;;StaticVariable Attribute /* ;;Explanation - This example demonstrates the use of the StaticVariable attribute to maintain values across multiple function calls. CVEmpStatic is declared as a static variable, so its values are not reset every time the function is executed. ;;Syntax [Function : ] StaticVariable : : : */ ;;=== Function Definition executing StaticVariable Attribute [Variable: CV Emp Static] Variable : Name : String : "Radhe" Variable : Age : Number : 10 [Function: TSPL StaticVariableFunction] StaticVariable : CVEmpStatic 00 : SET : CVEmpStatic.Name : ##CVEmpStatic.Name + "-" + $$String:##CVEmpStatic.Age 10 : INCREMENT : CVEmpStatic.Age : 2 20 : LOG : "Name - " + ##CVEmpStatic.Name + " , Age - " + $$String:##CVEmpStatic.Age ;;=== Button Definition call the function [Button : TSPL StaticVariableButton] Title : "Click here" Action : Call : TSPL StaticVariableFunction Key : Alt + R ;;=== Report to demonstrate the working of 'StaticVariable' attribute in Function definition using Button 'TSPL StaticVariableButton' [#Menu: Gateway of Tally] Add : Item : "StaticVariable Attribute" : Display : TSPL StaticVariableAttribute [Report: TSPL StaticVariableAttribute] Form : TSPL StaticVariableAttribute [Form: TSPL StaticVariableAttribute] Part : TSPL StaticVariableAttribute Button : TSPL StaticVariableButton [Part: TSPL StaticVariableAttribute] Line : TSPL StaticVariableAttribute Border : Thin Box [Line: TSPL StaticVariableAttribute] Field : TSPL StaticVariableAttribute Border : Thin Box [Field: TSPL StaticVariableAttribute] Use : Name Field Set as : "On pressing Alt + R, the static variable values are shown." Style : Normal Bold Width : 15 Cms ;;End of File