PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Special cases
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
The method for calling a procedure is the same, no matter whether it is a global procedure or a local procedure.
Reminder:
  • In WLanguage, there is no distinction between the procedures and the functions. The syntaxes for declaring and using the procedures also apply to the functions.
  • Versions 16 and later
    For a multi-syntax procedure, the call to the proper syntax is resolved at run time. See Prototype overload for more details.
    New in version 16
    For a multi-syntax procedure, the call to the proper syntax is resolved at run time. See Prototype overload for more details.
    For a multi-syntax procedure, the call to the proper syntax is resolved at run time. See Prototype overload for more details.
Example
// Call to the Find procedure that returns a boolean
IF Find(Customer, CustNum, Number) THEN
Info("Customer number found")
ELSE
Info("Customer number not found")
END
Syntax

Calling a procedure that returns a parameter Hide the details

[<Returned Value> = ] <Procedure Name>([<Parameters>])
<Returned Value>:
Value returned by the procedure (optional), only if the procedure returns a result.
Versions 18 and later
The type of the return value of a procedure can be specified during its declaration. See Declaring a procedure for more details.
New in version 18
The type of the return value of a procedure can be specified during its declaration. See Declaring a procedure for more details.
The type of the return value of a procedure can be specified during its declaration. See Declaring a procedure for more details.
<Procedure name>:
Name of the procedure to call.
<Parameters>:
Parameters passed to the procedure. Each parameter is separated by a comma.
See The parameters of a procedure for more details.
Versions 19 and later

Calling a procedure that returns several parameters Hide the details

(<Value 1>, ..., <Value N>) = <Procedure Name>([<Parameters>])
<Value 1 to N>:
Values returned by the procedure.
The type of the return values of a procedure can be specified during its declaration. See Declaring a procedure for more details.
<Procedure name>:
Name of the procedure to call.
<Parameters>:
Parameters passed to the procedure. Each parameter is separated by a comma.
See The parameters of a procedure for more details.
New in version 19

Calling a procedure that returns several parameters Hide the details

(<Value 1>, ..., <Value N>) = <Procedure Name>([<Parameters>])
<Value 1 to N>:
Values returned by the procedure.
The type of the return values of a procedure can be specified during its declaration. See Declaring a procedure for more details.
<Procedure name>:
Name of the procedure to call.
<Parameters>:
Parameters passed to the procedure. Each parameter is separated by a comma.
See The parameters of a procedure for more details.

Calling a procedure that returns several parameters Hide the details

(<Value 1>, ..., <Value N>) = <Procedure Name>([<Parameters>])
<Value 1 to N>:
Values returned by the procedure.
The type of the return values of a procedure can be specified during its declaration. See Declaring a procedure for more details.
<Procedure name>:
Name of the procedure to call.
<Parameters>:
Parameters passed to the procedure. Each parameter is separated by a comma.
See The parameters of a procedure for more details.
Remarks

Special cases

  • To make your programs more readable, the PROCEDURE keyword can be replaced by the FUNCTION keyword.
  • If the procedure expects no parameter, you can also use the following syntax:
    [<Returned Value> = ] <Procedure Name>
  • To run a procedure of an opened window, all you have to do is use ExecuteProcess. Example:
    // Run the MyProc procedure found in WIN_MyWindow
    WinName is string = "WIN_MyWindow"
    ExecuteProcess(WinName + ".MyProc", trtProcedure)
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment