|
|
|
|
|
Android and Java: call WLanguage procedures
A global procedure in WLanguage can be called directly from the code of a global procedure in Java. To call a WLanguage procedure directly from the code of a global procedure in Java: - Type the code of WLanguage procedure. The WLanguage procedure must comply with some rules:
- The procedure and the set of procedures to which it belongs must have a valid name in Java.
- The type of procedure parameters and the type of return value must be supported types: boolean, integer, 8-byte integer, real, string. We advise you to pass the parameters by value via the "LOCAL" keyword.
- The "Java" attribute must be added to the WLanguage procedure.
Example:
PROCEDURE nWL_AddOne(n is int), Java: int RESULT n+1
- Then, simply call the procedure from the Java code. The name of the procedure must be prefixed with the name of the set of procedures (you can also add the import to avoid using prefixes).
For example:
int nReturnInt(int i) { return MySet.nWL_AddOne(i); }
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|