PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Other statements used to exit a loop or a procedure
  • Using the RETURN keyword to return a value
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The RETURN statement is used to exit a statement block and the current process (or procedure).
The RETURN statement can be used in:
Versions 16 and later
In a procedure, you also have the ability to assign a value to the RETURN keyword. This value can be re-read at any time. This value will be automatically returned when exiting the procedure (standard exit from the procedure or exit from the procedure via the RETURN keyword).
New in version 16
In a procedure, you also have the ability to assign a value to the RETURN keyword. This value can be re-read at any time. This value will be automatically returned when exiting the procedure (standard exit from the procedure or exit from the procedure via the RETURN keyword).
In a procedure, you also have the ability to assign a value to the RETURN keyword. This value can be re-read at any time. This value will be automatically returned when exiting the procedure (standard exit from the procedure or exit from the procedure via the RETURN keyword).
Versions 16 and later
Universal Windows 10 App This feature is available for Windows Phone applications.
New in version 16
Universal Windows 10 App This feature is available for Windows Phone applications.
Universal Windows 10 App This feature is available for Windows Phone applications.
Versions 18 and later
Universal Windows 10 App This feature is available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This feature is available in Windows Store apps mode.
Universal Windows 10 App This feature is available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This feature is available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This feature is available in Universal Windows 10 App mode.
Universal Windows 10 App This feature is available in Universal Windows 10 App mode.
Syntax

Procedure

PROCEDURE <Procedure name> ([<Parameter>])
  IF <Condition> THEN RETURN
  ...
  END

FOR statement

FOR <Control variable> = <Initial value> TO <Final value> [STEP <x>]
  IF <Condition> THEN RETURN
END

FOR EACH statement

FOR EACH <File> ON <Key item>
  IF <Condition> THEN RETURN
END

LOOP statement

LOOP
  ...
  IF <Condition> THEN RETURN
  ...
END

WHILE statement

WHILE <Condition 1>
  ...
  IF <Condition> THEN RETURN
  ...
END
The following operations are performed if <Condition> is True:
  • Exit the statement block.
  • Exit the current process (or procedure).
Remarks

Other statements used to exit a loop or a procedure

The BREAK statement exits the loop and executes the rest of the current process (or procedure).
Close is used to exit from the loop (or procedure) and to close the current window.
Versions 16 and later

Using the RETURN keyword to return a value

In a procedure, you also have the ability to assign the return value before the actual exit from the procedure. For example:
...
RETURN = fReadLine(nFile)
fClose(nFile)
You also have the ability to re-read the value assigned by RETURN so that there is no need to declare a local variable to contain the result. For example:
IF RETURN = 1 THEN...
The value assigned to RETURN will be returned to the calling process:
  • at the end of procedure
  • when using the RETURN keyword to exit the process (equivalent to the RETURN statement).
New in version 16

Using the RETURN keyword to return a value

In a procedure, you also have the ability to assign the return value before the actual exit from the procedure. For example:
...
RETURN = fReadLine(nFile)
fClose(nFile)
You also have the ability to re-read the value assigned by RETURN so that there is no need to declare a local variable to contain the result. For example:
IF RETURN = 1 THEN...
The value assigned to RETURN will be returned to the calling process:
  • at the end of procedure
  • when using the RETURN keyword to exit the process (equivalent to the RETURN statement).

Using the RETURN keyword to return a value

In a procedure, you also have the ability to assign the return value before the actual exit from the procedure. For example:
...
RETURN = fReadLine(nFile)
fClose(nFile)
You also have the ability to re-read the value assigned by RETURN so that there is no need to declare a local variable to contain the result. For example:
IF RETURN = 1 THEN...
The value assigned to RETURN will be returned to the calling process:
  • at the end of procedure
  • when using the RETURN keyword to exit the process (equivalent to the RETURN statement).
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment