66. Storing mode 7 screen ~~~~~~~~~~~~~~~~~~~~~ It can sometimes be useful to be able to store a screenful of information within a program, and to be able to recall it at will, without having to store all the appropriate variables. This is especially easy and quick with Mode 7 screens, although it can be done on others. The example below stores just one screenful at a time, but you could DIM extra space to save several screens at once, eg. DIM screen1% 1000,screen2% 1000,...... If you only want to save part of the screen, then reduce the upper and lower limits of the FOR-NEXT loop. The cursor is also returned to its original position on the screen. To prevent corruptions, it is a good idea to disable the Escape key while the screen is being loaded or saved, using the appropriate *FX command*. This will only correctly save a screen which hasn't been scrolled since the last MODE or CLS command. For this reason, it may also be necessary to use CLS before reloading a screen. Note that unlike true variables such as mem%, it is essential for HIMEM to be in brackets, due to a Basic interpreter quirk. PAGE and TOP, which are similar pseudo-variables, do not suffer from this problem. NB: *FX229,1 inhibits the Escape action *FX229 enables the Escape action 10 DIM screen% 1000:REM have this early in program 1000 DEF PROCsavescreen:LOCAL mem% 1010 FOR mem%=0 TO 996 STEP 4:mem%!screen%=mem%!(HIMEM) 1020 NEXT:vpos%=VPOS:pos%=POS:ENDPROC 2000 DEF PROCloadscreen:LOCAL mem% 2010 FOR mem%=0 TO 996 STEP 4:mem%!(HIMEM)=mem%!screen% 2020 NEXT:VDU31,pos%,vpos%:ENDPROC