1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-29 11:40:38 +00:00
QB64-PE/internal/help/VIEW_PRINT.txt
SteveMcNeill 33adc04fc4 Add temp folder to repo. It's necessary as well!
Just more initial setting on... nothing much to see here.
2022-04-28 13:39:56 -04:00

62 lines
2.2 KiB
Plaintext

The [[VIEW PRINT]] statement defines the boundaries of a text viewport {{KW|PRINT}} area.
{{PageSyntax}}
: '''VIEW PRINT''' [{{Parameter|topRow%}} '''TO''' {{Parameter|bottomRow%}}]
{{Parameters}}
* {{Parameter|topRow%}} and {{Parameter|bottomRow%}} specify the upper and lower rows of the text viewport.
* If {{Parameter|topRow%}} and {{Parameter|bottomRow%}} are not specified when first used, the text viewport is defined to be the entire screen.
{{PageDescription}}
* A second [[VIEW PRINT]] statement without parameters can also disable a viewport when no longer needed.
* [[CLS]] or [[CLS|CLS 2]] statement will clear the active text viewport area only, and reset the cursor location to {{Parameter|topRow%}}.
* A {{KW|SCREEN}} mode change or {{KW|RUN}} statement can also clear and disable viewports.
* After active viewport is disabled, normal screen printing and clearing can begin.
* Row coordinates may vary when a [[WIDTH]] statement has been used.
* '''Note: QB64 [[RUN]] statements will not close [[VIEW PRINT]], [[VIEW]] or [[WINDOW]] view ports presently!'''
''Example:'' Demonstrates how text scrolls within the text viewport.
{{CodeStart}}' clear the entire screen and show the boundaries of the new text viewport
{{Cl|CLS}}
{{Cl|PRINT}} "Start at top..."
{{Cl|LOCATE}} 9, 1: {{Cl|PRINT}} "<- row 9 ->"
{{Cl|LOCATE}} 21, 1: {{Cl|PRINT}} "<- row 21 ->"
' define new text viewport boundaries
{{Cl|VIEW PRINT}} 10 {{Cl|TO}} 20
' print some text that will scroll the text viewport
{{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 15
{{Cl|PRINT}} "This is viewport line:"; i
{{Cl|SLEEP}} 1
{{Cl|NEXT}} i
' clear only the active text viewport with CLS or CLS 2
{{Cl|CLS}}
{{Cl|PRINT}} "After clearing, the cursor location is reset to the top of the text viewport."
' disable the viewport
{{Cl|VIEW PRINT}}
{{Cl|_DELAY}} 4
{{Cl|LOCATE}} 20, 20: {{Cl|PRINT}} "Print anywhere after view port is disabled"
{{Cl|_DELAY}} 4
{{Cl|CLS}}
{{Cl|PRINT}} "Back to top left after CLS!" '' ''
{{CodeEnd}}
: ''Note:'' The bottom row of the VIEW PRINT port can be used only when located or prints end with semicolons.
{{PageSeeAlso}}
* [[CLS]]
* [[WINDOW]]
* [[VIEW]] {{text|(graphics view port)}}
* [[LOCATE]], [[PRINT]]
{{PageNavigation}}
<