Tuto WEBDEV 25

460 Part 13: The WLanguage basics Internal procedure To create an internal procedure , type the following code in the requested process: INTERNAL PROCEDURE <Procedure name>() <Code of internal procedure> END Calling a procedure To call a procedure , use the procedure name (with the possible parameters that will be passed to it). <Procedure name>(<Parameter 1>, ..., <Parameter N>) See the online help for more details (keyword: "Procedure"). Procedure parameters What is a parameter? A parameter is a value sent to a procedure during the call to the procedure. The following example is used to call the Multiply10 procedure and to pass in parameter the value that will be handled in the procedure: Multiply10(50) You have the ability to pass from 0 to several values in parameter to a procedure. These values can have any type (as with the variables). The parameter is specified in the procedure declaration in the format of a variable. For example, for the Multiply10 procedure, the procedure code is: PROCEDURE Multiply10(P) P=P*10 P is the parameter expected by the procedure. Remark To specify the parameter role in the procedure, you have the ability to typecast the parameter in the procedure declaration. For example, to use numeric values only, you have the ability to declare: PROCEDURE Multiply10(P is numeric) In the following example, the Multiplication procedure expects two Integer parameters and returns the multiplication result. The procedure code is as follows: PROCEDURE Multiplication(Nb1 is int, Nb2 is int) MyResult is int MyResult = Nb1 * Nb2 RESULT MyResult

RkJQdWJsaXNoZXIy NDQ0OA==