ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage syntax / Structured statements
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
Assignment of RETURN
In french: Affectation de RETOUR
The return value of the process currently run can be assigned. The return value is stored and the process continues to run
Example
PROCÉDURE FindFile(SoughtValue)
// By default, return "" if the sought value is not found
RETURN = ""
// Open the data file
HOpen(AFile)
// Find the record
HReadSeek(AFile, SoughtItem, SoughtValue)
// Retrieve the item if the record was found
IF HFound() = True THEN
RETURN = AFile.Item
END
// Close the data file again
HClose(AFile)
Syntax
RETURN = <Value>
<Value>:
Value to return.
Remarks
  • There is no need to use the RETURN keyword at the end of the process: the stored value is automatically returned.
  • The return value can be assigned several times: the stored value always corresponds to the last assigned value.
  • To read the stored value again, use the RETURN keyword:
    PROCEDURE MyProcedure(): int
    RETURN = 1
     
    END:
    Trace("Returned value:" + RETURN)
  • To exit the process before the end of the code and return the stored value, use the RETURN keyword.
  • To exit the process before the end of the code and return a value different from the stored value, use the standard syntax:
    RESULT <Value>
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/06/2023

Send a report | Local help