|
|
|
|
|
Android and Java: WLanguage procedure calls
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 WLangage procedure as well as the return value must be typed with the supported types: Boolean, integer, integer over 8, real, string, etc.. 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_AjouteUn(n is an integer), Java: integer
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…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|