It uses the VTAB command to find the starting address of each line, then adds a character counter to index across the screen. This routine is easily included as a subroutine in an application program.
NOTE: This program will work for 40 columns only!
10 FOR V = 1 TO 24
20 VTAB V
30 P = PEEK (40) + PEEK (41) * 256
40 FOR H = 0 TO 39
50 PRINT CHR$( PEEK (P+H));
60 NEXT H
70 PRINT
80 NEXT V
90 END
Decreasing the limits of V and H in lines 10 and 40 limits the program to send only part of the screen.