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.
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.
C# Code | BDL Script |
---|---|
[Transaction(Etranstype.TRANSTYPE_MAIN)] public object TMain1(string s, int n) { } |
dcltrans transaction TMain1 var hReturn : number; begin DotNetSetString("stringvalue"); DotNetSetInt(123); DotNetCallMethod(hVuser1, "TMain1"); DotNetGetObject(hReturn); end; |