AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Sintaxis WLanguage / Instrucciones estructuradas
  • Operating mode
  • Special case
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
The END: label is used to define a code that will be systematically run at the end of process execution. This code will be run even if the exit from process is performed by RETURN or RETURN (except for an exception process triggered by ExceptionThrow).
Ejemplo
PROCEDURE CompareContenu(Fic1, Fic2)

// Ouvre les fichiers
nFic1 is int = fOuvre(Fic1, foRead)
nFic2 is int = fOuvre(Fic2, foRead)

// En cas d'erreur d'ouverture, renvoie -3
IF nFic1 = -1 OR nFic2 = -1 THEN RETURN -3

// Lit la première ligne de chaque fichier
sLigne1 is string = fLitLigne(nFic1)
sLigne2 is string = fLitLigne(nFic2)
nLigne is int = 1

LOOP
	// Si les deux lignes sont vides, c'est la fin des deux fichiers
	// Renvoie 0 
	IF sLigne1 = EOT _AND_ sLigne2 = EOT THEN RETURN 0

	// Si fin du fichier 1, le fichier 1 est plus court
	// renvoie -1 
	IF sLigne1 = EOT THEN RETURN -1

	// Si fin du fichier 2, le fichier 2 est plus court
	// renvoie -2 
	IF sLigne2 = EOT THEN RETURN - 2

	// Si les lignes sont différentes, renvoie le numéro de la ligne différente 
	IF sLigne1 <> sLigne2 THEN RETURN nLigne

	// Passe à la ligne suivante
	sLigne1 = fReadLine(nFic1) 
	sLigne2 = fReadLine(nFic2)
	nLigne++
END

END:
// Ferme les fichiers
fClose(nFic1)
fClose(nFic2)
Sintaxis
// Main code
...
IF ...THEN
  ...
  RETURN 0
END
...
IF ...THEN
  ...
  RETURN 1
END

RETURN 2

// Statements run in all cases
// at the end of process execution
END:
...
Observaciones

Operating mode

The value to return is stored and the code following the "END:" label is run. The value is returned at the end of execution of the code following the "END:" statement
Remark: The tag FIN: is also executed after automatic error handling if enabled (with the keywords "CASE ERROR:" and "CASE EXCEPTION:")..

Special case

The code following the "END:" label is not run after a call to SetFocusAndReturnToUserInput or to Close. SetFocusAndReturnToUserInput can be replaced with the call to ScreenFirst followed by RETURN or RESULT.
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 24/09/2024

Señalar un error o enviar una sugerencia | Ayuda local