The Code Generation Engine checks methods for their return values and input parameters. If a method has an input parameter that has the same name as a previously returned value, the return value will be passed to the function. Normally return parameters do not have names assigned to them - but you can assign a name by applying a BdlParameter attribute.
As a result, you can pass values between method calls by giving the parameters and return values the same names. When you declare the parameters, ensure that you do not assign the same name to different parameter types. In Silk Performer the Code Generation Engine does not check if the return value and input parameter types are the same.
C# Code | BDL Script |
---|---|
[Transaction(Etranstype.TRANSTYPE_MAIN)] [return:BdlParameter("sName")] public string TMain() { return "Andi"; } [TestMethod] public void Hello(string sName) { Bdl.Print("Hello " + sName); } |
dcltrans transaction Tmain var sName : string; begin DotNetCallMethod(hVuser1, "TMain"); DotNetGetString(hVuser1, sName, sizeof(sName)); DotNetSetString(hVuser1, sName); DotNetCallMethod(hVuser1, "Hello"); end; |