Adding to what Roland said, here is a code example of how to call C# assemblies using our internal test version of PB 2019 R2:
lcsa_assem = create CSharpAssembly
lcsa_object = create CSharpObject
ll_return = lcsa_assem.loadwithnetframework("NetAssemTest.dll", false)
mle_1.text += "lcsa_assem.loadwithnetframework:"+ string(ll_return) + "error:"+string(lcsa_assem.errortext)+"~r~n"
ll_return = lcsa_assem.createinstance("assemblynet.CSharpClass",lcso_object)
mle_1.text += "createinstance:"+ string(ll_return) +"~r~n"
li_c = 1
li_c = lcso_object.GetSalary()
mle_1.text += "GetSalary return =10000:"+ string(li_c)+"~r~n"
And here are some important details to be aware of:
- All standard datatypes are supported except the object type. Supported standard datatypes: short, ushort, int, uint, long, byte, bool, string/char, float, decimal, byte[], dateime and so on.
- You can return a C# array an assign it to a PowerScript array. We have tested one-dimensional array so far.
- The datatypes defined in C# do NOT have to have the same arguments as that in PowerScript. For example, you can define the decimal datatype in C#, and then PowerScript will pass the int/decimal value to C#.
Once PB 2019 R2 is released, we will most likely schedule a webinar to demonstrate and educate about this new feature. If you are not yet subscribed to Appeon newsletter, we suggest you subscribe so you get notified: http://eepurl.com/bGcjSD