VBScript mientras ... Wend Loop
en un While..Wend bucle, si la condición es Verdadera, todas las declaraciones se ejecutan hasta Wend se encuentra la palabra clave.
Si la condición es falsa, se sale del bucle y el control salta a la siguiente instrucción después de Wend palabra clave.
Sintaxis
La sintaxis de un While..Wend bucle en VBScript es -
While condition(s)
[statements 1]
[statements 2]
...
[statements n]
Wend
Diagrama de flujo
Ejemplo
<!DOCTYPE html>
<html>
<body>
<script language = "vbscript" type = "text/vbscript">
Dim Counter : Counter = 10
While Counter < 15 ' Test value of Counter.
Counter = Counter + 1 ' Increment Counter.
document.write("The Current Value of the Counter is : " & Counter)
document.write("<br></br>")
Wend ' While loop exits if Counter Value becomes 15.
</script>
</body>
</html>
Cuando se ejecuta el código anterior, imprime la siguiente salida en la consola.
The Current Value of the Counter is : 11
The Current Value of the Counter is : 12
The Current Value of the Counter is : 13
The Current Value of the Counter is : 14
The Current Value of the Counter is : 15