Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is wrong with this for/next loop
#7
This can be prevented, for example, in this way:

Code: (Select All)

'For-Schleife und Ausgabe des letzten Wertes - 15. April 2025

Option _Explicit

Dim As Integer i, j

Print
For i = 1 To 5
  Print i
Next

Print
Print i


Print: Print "------------------------"
Print
For j = 1 To 5
  Print j
  If j = 5 Then
    'Keine Zuweisung mehr
    Exit For
  End If
Next

Print
Print j

End
Reply


Messages In This Thread
RE: What is wrong with this for/next loop - by Kernelpanic - 04-15-2025, 05:11 PM



Users browsing this thread: 1 Guest(s)