;;Object Attribute /* ;;Explanation - This example shows how the Object attribute controls the object context of a function. - Here, Object : Ledger : "Cash" explicitly sets the function's context to the Cash Ledger, overriding the caller's default context. As a result, the function can directly access ledger fields like $ClosingBalance. The closing balance is stored in a variable and displayed in a message box. - In short, the Object attribute forces the function to run in a specific object context so its fields and methods can be used directly. ;;Syntax [Function : ] Object : : */ ;;=== Function Definition executing Object Attribute [Function: TSPL ObjectFunction] Variable : VarClosingBal : Amount Object : Ledger : "Cash" ;;The Object sets the current context to the Ledger and retrieves the methods for the Cash Ledger. 100 : Set : VarClosingBal : $ClosingBalance 200 : Msg Box : "Alert" : "Closing Balance for \n Ledger - Cash is " + ($$String:##VarClosingBal) + "/-" ;;=== Button Definition call the function [Button : TSPL ObjectButton] Title : "Click here" Action : Call : TSPL ObjectFunction Key : Alt + R ;;=== Report to demonstrate the working of 'Object' attribute in Function definition using Button 'TSPL ObjectButton' [#Menu: Gateway of Tally] Add : Item : "Object Attribute" : Display : TSPL ObjectAttribute [Report: TSPL ObjectAttribute] Form : TSPL ObjectAttribute [Form: TSPL ObjectAttribute] Part : TSPL ObjectAttribute Button : TSPL ObjectButton [Part: TSPL ObjectAttribute] Line : TSPL ObjectAttribute Border : Thin Box [Line: TSPL ObjectAttribute] Field : TSPL ObjectAttribute Border : Thin Box [Field: TSPL ObjectAttribute] Use : Name Field Set as : "On clicking button 'Alt + R', message box will appear." Style : Normal Bold Width : 10 Cms ;;End of File