|
|
|
|
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 directly from the code of a global procedure in Objective C: - Type the code of WLanguage procedure. The WLanguage procedure must comply with some rules:
- Have an acceptable name in Objective C.
- The type of procedure parameters and the type of return value must be supported types: boolean, integer, real, string, buffer.
- 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_AddOne(n is int), ObjC: int RESULT n+1 - Objective C code:
int nObjC_ResultInt(int i) { return nWL_AddOne(i); } Example: Procedure for displaying text: - WLanguage code:
PROCEDURE MyProcedure(psMessage is string), ObjC: string RETURN psMessage - Objective C code:
void ios_Call_Proc() { MyProcedure(@"My text"); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|