Lib CallLibraryFunction() Method

(SBM On-Premise only) Invokes the function from the library identified by name.

Function Signature

 int CallLibraryFunction( name, String& argStr1-7 )

int CallLibraryFunctionInt( name, Vector& argVect )

Variant CallLibraryFunction( name, [Variant& argVar1-7] )

Variant CallLibraryFunction( name, Vector& argVect )

Parameters

Parameter Type Description

name

string

The function to be invoked.

argStr

String&

(Input/Ouput) Takes between one and seven string parameters that are both input and output, requiring the strings to be created before being passed in to this function.

argVect

Vector&

(Input/Ouput) All entries in the Vector will be converted to string and passed as input/output parameters to the DLL.

If the DLL sets any of the parameters to a new value, the engine attempts to convert the string back to the original data type of the object inside the Vector. See example below.

argVar

Variant&

(Input/Ouput) Takes between one and seven optional Variant parameters that are both input and output. All parameters will be converted to string before being passed to the DLL. All params must be created before they are passed in to this function.

Return

Type Description

int

Returns the integer that the DLL function returned.

Variant

Returns the integer that the DLL function returned.

Technical Details

SBM ModScript version: 11.3. The string and CallLibraryFunctionInt signatures were added in 11.4.

Example

var v = [1,1.1,"2.5"];
lib.CallLibraryFunction( "Add", v );
// DLL added 3 values and set first parameter to result
Ext.WriteStream( v[0] ); 

Result:

4

Assuming the DLL added the three values passed in, and returned the result by setting the first argument to the new value, the result was converted from "4.6" to the integer found at v[0].

Notes

None.

Related Topics

Lib

Calling Your Function