;;Parameter Attribute /* ;;Explanation - This example demonstrates the use of the Parameter attribute to pass input values to a function. - Here, VarStkItem is passed as a parameter and is accessed inside the function like a variable. - The function walks through the batch collection, compares the item name with the passed stock item, and retrieves the corresponding batch name. - Parameters can have a defined data type and an optional default value, allowing the caller to skip passing a value when a default is provided. ;;Syntax [Function : ] Parameter : : */ ;;=== Function Definition executing Parameter Attribute [Function: TSPL ParameterFunction] Parameter: VarStkItem : String Variable : VarBatchNm : String 150 : Msg Box : "Check": ##VarStkItem 100 : Walk Collection : TSPL StockItemBatchList 200 : If : $ItemName = ##VarStkItem 300 : Set: VarBatchNm : $BatchName 350 : Log: "Batch Name - " + ##VarBatchNm 400 : End If 500 : End Walk [Collection: TSPL StockItem] Title : "List of Stock Items" Type : Stock Item [Collection: TSPL StockItemBatchList] Source Collection: TSPL StockItem Walk : Batch Allocations Compute : ItemName : $$Owner:$Name Fetch : Name,Parent,BatchName ;;=== Button Definition call the function [Button : TSPL ParameterButton] Title : "Click here" Action : Execute : TSPL selectItem Key : Alt + R [Report: TSPL selectItem] Title : "Select Item" Form : TSPL selectItem [Form: TSPL selectItem] Part : TSPL selectItem On : Form Accept: Yes: Call: TSPLParameterFunction:#TSPLselectItem On : Form Accept: Yes: Form Accept [Part: TSPL selectItem] Line : TSPL selectItem [Line: TSPL selectItem] Field : medium prompt, TSPL selectItem Local : Field: medium prompt : Set as: "Select Stock Item" Height : 6 mms [Field: TSPL selectItem] Use : Name Field Table : TSPL StockItem Show Table : Always Width : 3 Cms ;;=== Report to demonstrate the working of 'Parameter' attribute in Function definition using Button 'TSPL ParameterButton' [#Menu: Gateway of Tally] Add : Item : "Parameter Attribute" : Display : TSPL ParameterAttribute [Report: TSPL ParameterAttribute] Form : TSPL ParameterAttribute [Form: TSPL ParameterAttribute] Part : TSPL ParameterAttribute Button : TSPL ParameterButton [Part: TSPL ParameterAttribute] Line : TSPL ParameterAttribute Border : Thin Box [Line: TSPL ParameterAttribute] Field : TSPL ParameterAttribute Border : Thin Box [Field: TSPL ParameterAttribute] Use : Name Field Set as : "On pressing Alt + R, the Batch List will be displayed in Log on the Item Selection." Style : Normal Bold Width : 15 Cms ;;End of File