home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 15 / CD_ASCQ_15_070894.iso / vrac / dnalib7a.zip / SAVEREST.BAS < prev    next >
BASIC Source File  |  1994-05-14  |  1KB  |  61 lines

  1. SUB SaveScreen(ScreenID$,TopRow%,LeftColumn%,BottomRow%,RightColumn%,Shadow%) PUBLIC
  2.  
  3. $CODE SEG "DNASEG1"
  4.  
  5. DEF SEG = &HB800
  6.  
  7. ScreenID$ = ""
  8.  
  9. Rc% = RightColumn%
  10. Br% = BottomRow%
  11.  
  12. IF Shadow% = 1 THEN
  13.   INCR Rc%,2
  14.   INCR Br%
  15. END IF
  16.  
  17. Amount% = ((Rc% - LeftColumn%) * 2) + 2
  18.  
  19. FOR i% = TopRow% TO Br% STEP 1
  20.   Start% = ((i% - 1) * 160) + (LeftColumn% * 2) - 2
  21.   a$ = PEEK$(Start%,Amount%)
  22.   ScreenID$ = ScreenID$ + a$ + CHR$(255)
  23. NEXT i%
  24.  
  25. StringWidth$ = STR$(Amount%)
  26.  
  27. IF LEN(StringWidth$) > 3 THEN
  28.   StringWidth$ = LTRIM$(StringWidth$)
  29. ELSE
  30.   j% = 3 - LEN(StringWidth$)
  31.   StringWidth$ = SPACE$(j%) + StringWidth$
  32. END IF
  33.  
  34. ScreenID$ = StringWidth$ + ScreenID$
  35.  
  36. DEF SEG
  37.  
  38. END SUB
  39.  
  40. SUB RestoreScreen(ScreenID$,TopRow%,LeftColumn%) PUBLIC
  41.  
  42.  
  43. a$ = LEFT$(ScreenID$,3)                                 'get the 3 numbers from the string
  44. Divisor% = VAL(a$)                            'convert them to an integer
  45. TempScreen$ = LTRIM$(ScreenID$,a$)            'remove the extra characters
  46. NumRows% = LEN(TempScreen$) \ (Divisor% + 1)  'divide to find the amount
  47. BottomRow% = (TopRow% + NumRows%) - 1         'of rows
  48.  
  49. DEF SEG = &HB800
  50.  
  51. FOR i% = TopRow% TO BottomRow%
  52.   Start% = ((i% - 1) * 160) + (LeftColumn% * 2) - 2
  53.   b$ = LEFT$(TempScreen$,Divisor%)
  54.   POKE$ Start%,b$
  55.   TempScreen$ = LTRIM$(TempScreen$,b$)
  56.   TempScreen$ = LTRIM$(TempScreen$,CHR$(255))
  57. NEXT i%
  58.  
  59. DEF SEG
  60.  
  61. END SUB