Screen Files in Strings

Authors

Publication

Pub Details

Date

Pages

BASIC Terms

See all articles from Update April 1988

In January SDU Bill discussed the use of SCREEN$ files as a means of conserving RAM in programs such as SMART TEXT. Each SCREEN$, of course, takes 6912 bytes in disk file space or two cylinders in SDOS. The following demo listing shows how up to the maximum of 704 characters in a 32-column text screen such as a menu may be stored in a string, then printed back on-screen either from RAM storage or after retrieval from disk or tape files.

No graphics or UDGs are recognized by the SCREEN$ (x,y) function but this can be used to advantage by having a subroutine to set up screen borders, etc. then retrieving screen files and using PRINT OVER 1; a$ as many times as you wish to change the text. PRINT AT x,y; a$(a TO b) could also be used to alter specific parts of a text display. It does take awhile to chew away at a screen initially and put each character in the string, but once this is done and the file is saved as DATA a$() the access time is for only one cylinder of disk space. Because only about 1/10 the access time is required as compared to a SCREEN$ it would even be feasible to sequentially access a series of such files with tape data storage if RAM capacity was running short in a lengthy program. Use your imagination for other applications.

SCREEN STRING DEMO

  1 LET P=1
5 DIM A$(704)
10 FOR N=1 TO 704
20 PRINT CHR$ (RND*74+48);
30 NEXT N
35 PRINT #0;"Original display transfer to A$"
40 FOR V=0 TO 21
50 FOR H=0 TO 31
60 LET A$(P)=SCREEN$ (V,H)
65 LET P=P+1
70 NEXT H
80 NEXT V
90 CLS
100 PRINT A$;#0;"A$ printed from VARS file"
105 PAUSE 100
110 SAVE /"SCREEN" DATA A$()
115 CLEAR
120 PRINT #0;"Re-loading data just saved"
125 LOAD /"SCREEN" DATA A$()
130 LET a$( TO 17)=" ": REM Demo of how blank spaces in screen data will not overprint graphics or UDGs in border when OVER 1 is used
135 PRINT " BORDER HERE "
140 INPUT "": PRINT OVER 1;AT 0,0;A$;#0;"A$ from disk file to VARS prtout"
150 PAUSE 300
160 STOP
200 REM GO TO 120 to repeat disk file display
9999 SAVE /"SCREEN" LINE 1

Products

 

Media

 

Image Gallery

Source Code

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

Scroll to Top