ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage syntax / Structured statements
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
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
PROCEDURE ChercheFichier(ValeurRecherche)
// Par défaut, si la valeur recherchée n'est pas trouvée, on renvoie ""
RETURN = ""
// On ouvre le fichier de données
HOpen(UnFichier)
// On cherche l'enregistrement
HReadSeek(UnFichier, RubriqueRecherche, ValeurRecherche)
// Si on a trouvé l'enregistrement, on récupère la rubrique
IF HFound() = True THEN
	RETURN = UnFichier.Rubrique
END
// On referme le fichier de données
HClose(UnFichier)
Syntax
RETURN = <Value>
<Value>:
Value to return.
Remarks
  • At the end of processing, there's no need to use the RETURN keyword: the stored value is automatically returned.
  • The return value can be assigned several times: the stored value always corresponds to the last value assigned.
  • To read the stored value again, use the RETURN keyword:
    PROCEDURE MaProcédure() : int
    RETURN = 1
    
    END:
    Trace("Valeur retournée :" + 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:
    RENVOYER <Valeur>
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/24/2024

Send a report | Local help