home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 15
/
CD_ASCQ_15_070894.iso
/
vrac
/
dnalib7a.zip
/
SAVEREST.BAS
< prev
next >
Wrap
BASIC Source File
|
1994-05-14
|
1KB
|
61 lines
SUB SaveScreen(ScreenID$,TopRow%,LeftColumn%,BottomRow%,RightColumn%,Shadow%) PUBLIC
$CODE SEG "DNASEG1"
DEF SEG = &HB800
ScreenID$ = ""
Rc% = RightColumn%
Br% = BottomRow%
IF Shadow% = 1 THEN
INCR Rc%,2
INCR Br%
END IF
Amount% = ((Rc% - LeftColumn%) * 2) + 2
FOR i% = TopRow% TO Br% STEP 1
Start% = ((i% - 1) * 160) + (LeftColumn% * 2) - 2
a$ = PEEK$(Start%,Amount%)
ScreenID$ = ScreenID$ + a$ + CHR$(255)
NEXT i%
StringWidth$ = STR$(Amount%)
IF LEN(StringWidth$) > 3 THEN
StringWidth$ = LTRIM$(StringWidth$)
ELSE
j% = 3 - LEN(StringWidth$)
StringWidth$ = SPACE$(j%) + StringWidth$
END IF
ScreenID$ = StringWidth$ + ScreenID$
DEF SEG
END SUB
SUB RestoreScreen(ScreenID$,TopRow%,LeftColumn%) PUBLIC
a$ = LEFT$(ScreenID$,3) 'get the 3 numbers from the string
Divisor% = VAL(a$) 'convert them to an integer
TempScreen$ = LTRIM$(ScreenID$,a$) 'remove the extra characters
NumRows% = LEN(TempScreen$) \ (Divisor% + 1) 'divide to find the amount
BottomRow% = (TopRow% + NumRows%) - 1 'of rows
DEF SEG = &HB800
FOR i% = TopRow% TO BottomRow%
Start% = ((i% - 1) * 160) + (LeftColumn% * 2) - 2
b$ = LEFT$(TempScreen$,Divisor%)
POKE$ Start%,b$
TempScreen$ = LTRIM$(TempScreen$,b$)
TempScreen$ = LTRIM$(TempScreen$,CHR$(255))
NEXT i%
DEF SEG
END SUB