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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Exiting sub while inside a loop PhilOfPerth 5 525 12-05-2025, 09:40 AM
Last Post: PhilOfPerth
  Do Loop, Sleep and Mouse Button Dimster 5 599 09-06-2025, 12:57 PM
Last Post: Dimster
  Using modulo to loop through lists fistfullofnails 3 726 09-03-2025, 11:50 PM
Last Post: fistfullofnails
  Simple Addition gone wrong Dimster 13 1,478 08-22-2025, 09:00 PM
Last Post: Pete
  Either I'm doing MID$( wrong or it has a bug TDarcos 4 825 04-13-2025, 11:14 PM
Last Post: TDarcos

Forum Jump:


Users browsing this thread: 1 Guest(s)