- How to?
- Use example for a .Net assembly
C#: Call to WLanguage procedure
A global procedure in WLanguage can be directly called from the code of a global procedure in C#.
To call a WLanguage procedure from the code of a global procedure in C#:
- Type the code of WLanguage procedure. The WLanguage procedure must comply with some rules:
- Have an acceptable name in C#.
- The type of procedure parameters and the type of return value must be supported types: boolean, integer, real, string, buffer. We advise you to pass the parameters by value via the "LOCAL" keyword.
- The extension attribute "C#" must be added to the WLanguage procedure.
PROCEDURE nWL_AddOne(LOCAL n is int), C#: int
- Then, all you have to do is call the procedure from the C# code.
int nCSharp_ResultInt(int i)
Use example for a .Net assembly
A global procedure in C# can call assembly functions by using using
- Global procedure displaying a "YesNo" message:
public static bool pTEST(string _sMessage, string _sTitle)
result = MessageBox.Show (_sMessage, _sTitle, MessageBoxButtons.YesNo,
return (result == System.Windows.Forms.DialogResult.Yes);
- Call to the procedure from WLanguage (click code of a button or other):
bRes = pTEST("This is my message", "My configured title")
Info("YesNo in C# returned" + (bRes? "Yes" ELSE "No"))