Option
Explicit
Public
Sub
test()
Dim
intI
As
Integer
Dim
intSumme
As
Integer
Dim
strText
As
String
intSumme = 0
For
intI = 0
To
10
intSumme = intSumme + intI
Next
strText =
"Schleife 1: "
& intI &
" Durchläufe"
& vbCr
intSumme = 0
intI = 0
While
intSumme < 55
intI = intI + 1
intSumme = intSumme + intI
Wend
strText = strText &
"Schleife 2: "
& intI &
" Durchläufe"
& vbCr
intSumme = 0
intI = 1
While
intSumme < 55
intSumme = intSumme + intI
intI = intI + 1
Wend
strText = strText &
"Schleife 3: "
& intI - 1 &
" Durchläufe"
& vbCr
intSumme = 0
intI = 1
While
intI < 10
intSumme = intSumme + intI
intI = intI + 1
Wend
strText = strText &
"Schleife 4: "
& intI - 1 &
" Durchläufe"
& vbCr
intSumme = 0
intI = 0
Do
intI = intI + 1
intSumme = intSumme + intI
Loop
Until
intSumme > 54
strText = strText &
"Schleife 5: "
& intI &
" Durchläufe"
& vbCr
intSumme = 0
intI = 0
Do
intI = intI + 1
intSumme = intSumme + intI
Loop
Until
intSumme < 55
strText = strText &
"Schleife 6: "
& intI &
" Durchläufe"
& vbCr
intSumme = 0
intI = 0
Do
intI = intI + 3
intSumme = intSumme + intI
Loop
Until
intI >= 10
strText = strText &
"Schleife 7: "
& intI \ 3 &
" Durchläufe"
Call
MsgBox(strText)
End
Sub