|
|
|
|
|
Android and Java: Calling 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 the 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 parameters of the WLanguage procedure and the return value must be of a supported type: Boolean, integer, 8-byte integer, real or 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
RETURN 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…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|