04-09-2024, 05:12 PM
(04-08-2024, 09:28 PM)Tim Wrote: I have been trying to figure out how to do this, scroll program output when it fills more than one screenful , but I have had no luck so far. I am currently working on Lesson 4 of Terry's Tutorial. Some example programs, as well as my own experiments, use a lot more screen length than just one. For example, one of the example programs counts to 100 (from whatever starting point you give it); I would like to be able to see all of the output from it (as well as the results of my own hacks, which I do in order to make sure I can replicate and understand creatively what the lesson(s) teach).I'm not sure if this would help, but here's a simple method I use for displaying long instructions for my QB64 games:
Code: (Select All)
Sub ShowInstructions
Dim in$: in$ = GetInstructions$
Dim iLoop As Integer
Dim iCount As Integer: iCount = 0
Dim iRows As Integer: iRows = _Height(0) \ _FontHeight ' GET # OF AVAILABLE TEXT ROWS
ReDim arrLines(-1) As String
Cls
split in$, Chr$(13), arrLines() ' SPLIT OUTPUT INTO LINES
For iLoop = LBound(arrLines) To UBound(arrLines)
' WHEN MAX LINES ARE DISPLAYED, PAUSE AND WAIT FOR USER TO PRESS <ENTER>
If arrLines(iLoop) <> Chr$(10) Then
Print arrLines(iLoop)
iCount = iCount + 1
If iCount > (iRows - 5) Then
Input "PRESS <ENTER> TO CONTINUE"; in$
iCount = 0
End If
Else
' Chr$(10) MEANS PAUSE, WAIT FOR USER, RESET LINE COUNTER
Input "PRESS <ENTER> TO CONTINUE"; in$
iCount = 0
End If
Next iLoop
Input "PRESS <ENTER> TO CONTINUE"; in$
End Sub ' ShowInstructions
' /////////////////////////////////////////////////////////////////////////////
' NOTE: Chr$(10) causes ShowInstructions to pause and wait for the user
' to press <ENTER>.
Function GetInstructions$
Dim in$
in$ = in$ + "my text here" + Chr$(13)
in$ = in$ + " " + Chr$(13)
in$ = in$ + "more text" + Chr$(13)
in$ = in$ + "etc. etc." + Chr$(13)
in$ = in$ + Chr$(10) + Chr$(13)' pause here
in$ = in$ + "another section" + Chr$(13)
in$ = in$ + "etc." + Chr$(13)
GetInstructions$ = in$
End Function ' GetInstructions$
Good Luck!