Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why does my Loop end after 11 Loops?
#27
It woiks!
save as "The file"
Code: (Select All)
Now
is
the
time
for
all
good
men
to
use
recursion
to
fill
their
days
with
joy
or
woe
is
me.

Code: (Select All)
Open "The file" For Input As #1
Recur
Sub Recur
    'Seek #1, 1
    If Not EOF(1) Then
        b$ = ""
        For i = 1 To 7
            Input #1, fline$
            b$ = b$ + " " + fline$
        Next
        DataCount = DataCount + 1
        'Call to the Subroutine to deal with the 7 data items
        do7 b$
        'If DataCount = 4000 Then Exit Sub
        Recur
    Else
        Close #1
        'and report to the principle
        Print "The file is now closed!"
    End If
End Sub

Sub do7 (x$)
    Print x$
End Sub

Interesting note: No Static nor Shared needed! And no dang Do... Loop
b = b + ...
Reply


Messages In This Thread
Why does my Loop end after 11 Loops? - by Dimster - 02-06-2023, 07:08 PM
RE: Why does my Loop end after 11 Loops? - by bplus - 02-07-2023, 09:15 PM



Users browsing this thread: 18 Guest(s)