VIEW PRINT 1 TO 25 is not a perfect solution for those who want to print to LINE 25 in QB. This function will allow the user to print over anything on LINE 25. You don't need to DIM the variable 'display' as string * 80. You can use display$, etc. I just like to do things the DIM way. :) Actually, that helps in that it creates a line that overwrites everything on the line the variable is written to.
Make it STRING * 40 and it will demonstrate when it reaches LINE 25, the 40-characters will be added to the line, which already has a message on it, and then that line will scroll up when the next entry is written. This is accomplished with the 'flag' variable.
Why bother with the 'flag' variable? OK, remove it and see what happens. When LINE 25 with the message is encountered, it will popup first and then write the new line under it, instead of writing over it. In other words, if nothing was on line 25 to begin with, you'd have a blank line at that level scrolling up the screen.
DIM display AS STRING * 80
VIEW PRINT 1 TO 25
LOCATE 25, 1: PRINT "Press a key. Eventually, This line will be printed over!"
LOCATE 23, 1
key$ = INKEY$
IF key$ = CHR$(27) THEN SYSTEM
LOOP UNTIL key$ <> ""
IF CSRLIN = 25 AND flag = 1 THEN PRINT : LOCATE 25, 1
display = "QBasic can do anything if you PUT you mind to it!
IF CSRLIN <> 25 THEN PRINT ELSE flag = 1
PS If someone discovers a simpler way to do this, by all means post it.