Do ... Loop 2

Der Do..Loop existiert in 4 Varianten
1) Einstiegs- oder Endbedingung
2) While oder Until

  Einstiegsbedingung Endbedingung
While Do While intcounter <= 10 
  ..
  intcounter = intcounter * 2
Loop 
Do  
  ..
  intcounter = intcounter * 2
Loop While intcounter <= 10
Until Do Until intcounter > 10 
  ..
  intcounter = intcounter * 2
Loop 
Do  
  ..
  intcounter = intcounter * 2
Loop Until intcounter <= 10


Die Bedingung kann sowohl als Einstiegsbedingung am Anfang wie auch als Endbedingung am Ende des Loops abgefragt werden. 
Bei Until wird der Loop solange ausgeführt, bis die Bedingung False ist. Bei While solange sie True ist.  

Do-Loop-Varianten


Letzter Update: 26.12.2021 17:48
Zurück zur Einführung ASP auf dem rothen ecotronics Web Site