|
|
|
|
|
Objective C: Calling a WLanguage procedure
A global procedure in WLanguage can be directly called from the code of a global procedure in Objective-C . To call a WLanguage procedure from the code of a global procedure in Objective-C: - Type the code of the WLanguage procedure. The WLanguage procedure must comply with some rules:
- It must have a valid name in Objective-C.
- The parameters of the WLangage procedure as well as the return value must be typed with the supported types: Boolean, integer, real, string, buffer, etc..
- The "ObjC" attribute must be added to the WLanguage procedure.
- Then simply call the procedure from the Objective-C code.
Example: Procedure for adding 1 to the specified number: - WLanguage code:
PROCEDURE nWL_AjouteUn(n is an integer), ObjC: integer
RETURN n+1
- Objective-C code:
int nObjC_ResultInt(int i) { return nWL_AddOne(i); } Example: Procedure for displaying a text: - WLanguage code:
PROCEDURE MyProcedure(psMessage is TO string), ObjC: string
resend psMessage
- Objective-C code:
void ios_Call_Proc() { MyProcedure(@"My text"); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|