1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-26 14:25:53 +00:00
QB64-PE/internal/help/VIEW_PRINT.txt
SMcNeill 6e01fc8dce Altered string compare routines (<,<=,>,>=) so they don't give false results with CHR$(0).
Added new _STRCMP and _STRICMP commands for quick string comparisons.
Cleaned up QB64 to finish removing the QUI (quick user insert) code and folders.
Altered UCASE and LCASE routines to be faster in some situations for us.
2014-09-22 08:19:03 -04:00

55 lines
2.1 KiB
Plaintext

The {{KW|VIEW PRINT}} statement defines the boundaries of a text viewport {{KW|PRINT}} area.
{{PageSyntax}}
:{{KW|VIEW PRINT}} [{{Parameter|topRow%}} TO {{Parameter|bottomRow%}}]
{{PageDescription}}
* {{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.
* A second {{KW|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.
''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}} &quot;Start at top...&quot;
{{Cl|LOCATE}} 9, 1: {{Cl|PRINT}} &quot;&lt;- row 9 -&gt;&quot;
{{Cl|LOCATE}} 21, 1: {{Cl|PRINT}} &quot;&lt;- row 21 -&gt;&quot;
' 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}} &quot;This is viewport line:&quot;; i
{{Cl|SLEEP}} 1
{{Cl|NEXT}} i
' clear only the active text viewport with CLS or CLS 2
{{Cl|CLS}}
{{Cl|PRINT}} &quot;After clearing, the cursor location is reset to the top of the text viewport.&quot;
' disable the viewport
{{Cl|VIEW PRINT}}
{{Cl|_DELAY}} 4
{{Cl|LOCATE}} 20, 20: {{Cl|PRINT}} &quot;Print anywhere after view port is disabled&quot;
{{Cl|_DELAY}} 4
{{Cl|CLS}}
{{Cl|PRINT}} &quot;Back to top left after CLS!&quot; '' ''
{{CodeEnd}}
: ''Note:'' The bottom row of the VIEW PRINT port can be used only when located or prints end with semicolons.
{{PageSeeAlso}}
* [[CLS]]
* [[VIEW]] {{text|(graphics view port)}}
* [[LOCATE]], [[PRINT]]
{{PageNavigation}}