;;LocalFormula Attribute /* ;; Explanation - This example demonstrates the use of Local Formula to calculate values within a function. - Date and Time are defined as Local Formulas, derived from the system's machine date and time. - These formulas are scoped to the function available only inside it. - Their values are used to build a message stored in VarDateTime, which is then displayed via a message box. ;;Syntax [Function : ] LocalFormula : : */ ;;=== Function Definition executing LocalFormula Attribute [Function: TSPL LocalFormulaFunction] Variable : VarDateTime : String LocalFormula : Date : $$String:$$MachineDate LocalFormula : Time : $$String:$$MachineTime 100 : Set : VarDateTime : "Todays's date is " + @Date + " \n and time is " + @Time + " hrs" 200 : Msg Box : "Alert" : ##VarDateTime ;;=== Button Definition call the function [Button : TSPL LocalFormulaButton] Title : "Click here" Action : Call : TSPL LocalFormulaFunction Key : Alt + R ;;=== Report to demonstrate the working of 'LocalFormula' attribute in Function definition using Button 'TSPL LocalFormulaButton' [#Menu: Gateway of Tally] Add : Item : "LocalFormula Attribute" : Display : TSPL LocalFormulaAttribute [Report: TSPL LocalFormulaAttribute] Form : TSPL LocalFormulaAttribute [Form: TSPL LocalFormulaAttribute] Part : TSPL LocalFormulaAttribute Button : TSPL LocalFormulaButton [Part: TSPL LocalFormulaAttribute] Line : TSPL LocalFormulaAttribute Border : Thin Box [Line: TSPL LocalFormulaAttribute] Field : TSPL LocalFormulaAttribute Border : Thin Box [Field: TSPL LocalFormulaAttribute] Use : Name Field Set as : "On clicking button 'Alt + R', message box will appear." Style : Normal Bold Width : 10 Cms ;;End of File