Difference between revisions of "VIEW PRINT"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
imported>Clippy
Line 33: Line 33:
  
  
''Explanation:'' The procedure uses [[LOCATE]] to place the column positions of the data. PRINTs without locate will also work their way to the bottom of the vie port. The last row (20 above) may or may not accept prints! Don't know why.  
+
''Explanation:'' The procedure uses [[LOCATE]] to place the column positions of the data. PRINTs without locate will also work their way to the bottom of the view port. The last row (20 above) may or may not accept prints! Don't know why.  
  
  

Revision as of 02:33, 20 September 2009

The VIEW PRINT statement creates a PRINT view port area to place PRINTS on the SCREEN.


Syntax: VIEW PRINT [top_row, bottom_row]


  • If parameters are not used in the first call to VIEW PRINT the area becomes the entire screen(?).
  • Row parameters are INTEGER values based on the SCREEN mode and any WIDTH setting used.
  • PRINT code should be placed between the opening and closing VIEW PRINT statements.
  • PRINTs not using LOCATE for rows outside of the view port will stay inside of the area.
  • CLS 2 statements will clear the view port area only. Further PRINTs will start at the top view port row.
  • To close a PRINT view port use VIEW PRINT without parameters after the view port code.


Example: Demonstrates how VIEW PRINT can display consecutive data.


VIEW PRINT 16 TO 20
LOCATE 16, 10 ' sets first line of view port when LOCATE is used
FOR i = 1 TO 30
COLOR 11: LOCATE , 30: PRINT "This is data line: "; i
SLEEP 1
NEXT
SLEEP 1
CLS 2
COLOR 15: LOCATE ,10: PRINT "VIEW PRINT 16 TO 20 'set view port to rows 16 to 20 for data"
LOCATE , 10: PRINT "FOR i = 1 TO 30: PRINT "; CHR$(34); "This is data line: "; CHR$(34); "; i : NEXT ' data display"
LOCATE , 10: PRINT "CLS 2 ' clear view port"
LOCATE , 10: PRINT "VIEW PRINT ' disable view port"
VIEW PRINT


Explanation: The procedure uses LOCATE to place the column positions of the data. PRINTs without locate will also work their way to the bottom of the view port. The last row (20 above) may or may not accept prints! Don't know why.


Navigation:

Go to Keyword Reference - Alphabetical

Go to Keyword Reference - By usage