This handy little subroutine can be used in two manners; to fill a screen page with repetitive material or to determine the length of a screen page of print statements. Assume line 100 is a print statement with which you wish to fill the page.
100 PRINT” “:GOSUB 400
400 IF PEEK(37) < 18 THEN RETURN
410 POP:PRINT “FOR NEW PAGE HIT ANY KEY”:CALL 756:GOTO 000
Line 400 reads the cursor and finds whereitis on the page. If less than 18 lines, print more lines. Line 410 “Pops” the return address from the stack. Instead of Call 756 you could use INPUT A$ or Call -676, all of which are a means of halting the program to await further instructions.