02-02-2023, 11:48 PM
(This post was last modified: 02-02-2023, 11:51 PM by PhilOfPerth.)
Here's a small test I've just run, which runs a snippet that calls a sub 10000 times, and exits early each time:
There was no change in the output, so I assume there was no corruption caused by the early exit. Is this a reasonable assumption?
Code: (Select All)
Screen 9
For runs = 1 To 100000 ' run the prog 10000 imes
Numbers:
For num = 1 To 10
Print num; ' print numbers 1 to 10
Next
letters ' now call the letters sub
Print
Print "Run #"; runs; "finished": Print ' show how many runs completed
Next
Print: Print "The final run should yield the same result as the first:"
Print " 1 2 3 4 5 6 7 8 9 10 ABCDEFGHIJ"
Sub letters
letrnum = 0
While letrnum < 26 ' repeat this loop 26 times
letr$ = Chr$(letrnum + 65) '
If letrnum = 10 Then Exit Sub ' Bail out early, after j
Print letr$; ' show letter A, then B etc until Z
letrnum = letrnum + 1 ' next letter
Wend
_Delay .1
End Sub
There was no change in the output, so I assume there was no corruption caused by the early exit. Is this a reasonable assumption?
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, W.A.)