Methods with Parameters

If a method, whether it is a transaction or a test method, has input parameters or a return value, the engine scripts DotNetSetXX functions to pass the input parameters and a DotNetGetXX function to retrieve the return value.

The following DotNetGetXX and DotNetSetXX functions are available:
  • DotNetSetString
  • DotNetSetInt
  • DotNetSetFloat
  • DotNetSetBoolean
  • DotNetSetObject
  • DotNetGetString
  • DotNetGetInt
  • DotNetGetFloat
  • DotNetGetBoolean
  • DotNetGetObject

Therefore you can exchange strings, integers, floats, Booleans, and objects. Objects are object handles to other .NET objects.

The Code Generation Engine scripts a DotNetSetXX function for each parameter in the same sequence as the parameter definition. If there is a return value, it scripts the corresponding DotNetGetXX function.

The Code Generation Engine creates appropriate values for input parameters such as 123 for the int in the example below. Silk Performer does not support arrays.

Methods with Parameters

C# Code BDL Script
public object TMain1(string s, int n)
  transaction TMain1
    hReturn : number;
    DotNetCallMethod(hVuser1, "TMain1");
The following .NET data types are supported:
  • String
  • Byte
  • SByte
  • UIntPtr
  • UInt16
  • UInt32
  • UInt64
  • Int16
  • Int32
  • Int64
  • IntPtr
  • Decimal
  • Double
  • Single
  • Boolean
  • Object