SAVE AND RESTORE A SCREEN - Lines 100 through 2 10 of the following program
can be used as a subroutine in other programs when you want to save something
you've created on the screen. (Be sure that you change the file name each time you use
the pr;)gram so that you don't write over a file that you have previously saved.) This
program only saves and restores the characters that are on the screen. Information
about redefined characters and colors is not saved.
1 00 REM SAVE A SCREEN
1 1 0 REM ADD AT END OF THE PROGRAM THAT PRODUCES THE SCREEN
1 20 REM
1 30 REM CHOOSE A UNIQUE FILENAME
1 40 OPEN #20:"device.file-name", INTERNAL
1 50 FOR ROW = 1 TO 24
1 60 FOR COLUMN = 1 TO 32
1 70 CALL GCHAR[ROW,COLUMN,X)
1 80 PRINT #20:X
1 90 NEXT COLUMN
200 NEXT ROW
21 0 CLOSE #20
The following runs as an independent program. It recalls the contents of a screen that
has been previously saved and then puts it on the screen.
40
1 00 REM REPRODUCE A SCREEN
1 1 0 OPEN #30:"device.file-name",INTERNAL
1 20 FOR ROW = 1
to
24
1 30 FOR COLUMN =
1 to
32
1 40 INPUT #30:X
1 50 CALL VCHAR[ROW,COLUMN,X)
1 60 NEXT COLUMN
1 70 NEXT ROW
1 80 CLOSE #30
1 90 REM DELAY TO GIVE TIME TO LOOK AT THE SCREEN
200 FOR DELAY = 1
to
1 0000
21 0 NEXT DELAY
Summary of Contents for PHP1240
Page 1: ......