brOpenRuleModule method

Creates a new instance of the clsD3RuleModule class that encapsulates the legacy FlashBASIC subroutine so it may be called from the application.

Note: See the Remarks section for RPC and ODBC connection exceptions.

Syntax

Set oRuleModule = object.brOpenRuleModule( sRuleItem, [ vsRuleFile], [ vsRuleBase])

Parameters

Parameter Description
oRuleModule An object variable that represents a clsD3RuleModule object to be created.
object An object variable that represents a clsD3Environment object.
sRuleIteme A String specifying the name of the compiled subroutine.
vsRuleFile Optional. A Variant (String subtype) specifying the file where the subroutine resides.
vsRuleBase Optional. A Variant (String subtype) specifying the account where the subroutine resides.

Remarks

  • Compile the subroutine using the FlashBASIC o option.

  • Using an RPC connection, FlashBASIC compiles and catalogs the program into the Rule Catalog.

  • Using an ODBC connection, FlashBASIC compiles and catalogs the program into the account's Master Dictionary.

Example

Sub Main()
   Dim oEnv As New clsD3Environment
   Dim oConn As clsD3Connection
   Dim oRule As clsD3RuleModule
   Dim vInput1 As Variant
   Dim vInput2 As Variant
   Dim vResult As Variant
 
   Set oConn = oEnv.brOpenConnection("ODBC", "production")
   oConn. ( brCompile " dm", "bp", " addit"
   oConn.brCatalog "dm", "bp", "addit"
 
   Set oRule = oConn.brOpenRuleModule("addit", "bp", "dm")
 
   vInput1 = CVar(5)
   vInput2 = CVar(7)
   oRule.brCall vResult, vInput1, vInput2
   MsgBox "The result is " & CInt(Result)
 
   vInput1 = CVar(2)
   vInput2 = CVar(3)
   oRule.brCall vResult, vInput1, vInput2
   MsgBox "The result is " & CInt(vResult)
 
   oConn.brCloseRuleModule oRule
   oEnv.brCloseConnection oConn
   Set oEnv = Nothing
End Sub