Copy methods and segment data

Use GetSegData(n) to retrieve data from a create rule segment. GetSegData can also retrieve user input supplied for a create rule.

In this example, the first segment is an Input segment. This segment is where a user inputs the name of a company. The SCRIPT segment for the create rule calls a copy method in which GetSegData retrieves the company name input from the first segment. Then ObjProperty can retrieve other detail from that object, such as the description.


Option Strict Off
imports System
imports System.Diagnostics

Class CopyScript
 Inherits FcProcFuncSetEventCopyMethod
 
Function execute() As Long
 Dim iBlank As Integer
  Dim lMessage As Long
 Dim Company as String = Context.GetSegData(1)
 Dim Desc As String = ObjProperty("DESCRIPTION", "COMPANY", Company)
 Context.ReturnValue = Desc
 End Function
End Class