home *** CD-ROM | disk | FTP | other *** search
/ RBBS in a Box Volume 1 #2 / RBBS_vol1_no2.iso / 007z / spltsc.bas < prev    next >
BASIC Source File  |  1985-08-02  |  3KB  |  67 lines

  1. 10  REM SPLTSCRN.BAS-Splits the screen at horizontal dividing line location             of your choice and scrolls each window up or down a
  2. 20  REM This program is set up as a demo, but by changing the appropriate vari          ables, you can change the size & location of the windows
  3. 30  REM TULR%=top window,upper left row:LLLC%=lower window,lower left column etc        Length must be < height of window.Length%=number of lines to ju
  4. 40  REM Submitted by Emile Alline 834-6444...also available on disk...enjoy!! 
  5. 50 : 
  6. 60     REM Poke a 64 byte machine lang routine at 32,768...relocate if desired 
  7. 70 DEF SEG:SCROLLR=&H8000 
  8. 80 FOR ADDRESS=SCROLLR TO SCROLLR+&H40:READ CODE:POKE ADDRESS,CODE:NEXT ADDRESS 
  9. 90 DATA &H55 
  10. 100 DATA &H8B,&HEC 
  11. 110 DATA &H50 
  12. 120 DATA &H53 
  13. 130 DATA &H51 
  14. 140 DATA &H52 
  15. 150 DATA &H56 
  16. 160 DATA &H8B,&HB6,&H10,&H00 
  17. 170 DATA &H8A,&H2C 
  18. 180 DATA &H8B,&HB6,&H0E,&H00 
  19. 190 DATA &H8A,&H0C 
  20. 200 DATA &H8B,&HB6,&H0C,&H00 
  21. 210 DATA &H8A,&H34 
  22. 220 DATA &H8B,&HB6,&H0A,&H00 
  23. 230 DATA &H8A,&H14 
  24. 240 DATA &H8B,&HB6,&H08,&H00 
  25. 250 DATA &H8A,&H3C 
  26. 260 DATA &H8B,&HB6,&H06,&H00 
  27. 270 DATA &H8A,&H04 
  28. 280 DATA &HFE,&HCD 
  29. 290 DATA &HFE,&HC9 
  30. 300 DATA &Hfe,&Hce 
  31. 310 DATA &HFE,&HCA 
  32. 320 DATA &HB4,&H06 :REM 06 =scroll up, 07 =scroll down 
  33. 330 DATA &HCD,&H10 
  34. 340 DATA &H5E 
  35. 350 DATA &H5A 
  36. 360 DATA &H59 
  37. 370 DATA &H5B 
  38. 380 DATA &H58 
  39. 390 DATA &H5D 
  40. 400 DATA &HCA,&H0C,&H00 
  41. 410     REM Set up location of dividing line,disregard illegal entries 
  42. 420 CLS:INPUT"Enter line number between 3 and 22 to set screen split";X:IF X<3 OR X>22 THEN 420 ELSE SPLIT=X 
  43. 430     REM Set up the dividing line between upper & lower windows 
  44. 440 CLS:KEY ON:LOCATE SPLIT,1:PRINT "********************* THIS IS WHERE THE SCREEN SPLITS **************************" 
  45. 450     REM Define upper window 
  46. 460 UULR%=1:UULC%=1:ULRR%=SPLIT-1:ULRC%=80:UATTR%=53:ULENGTH%=1 
  47. 470     REM Define lower window 
  48. 480 LULR%=SPLIT+1:LULC%=1:LLRR%=24:LLRC%=80:LATTR%=53:LLENGTH%=1 
  49. 490     REM Set initial cursor positions 
  50. 500 UCR=1:UCC=1:LCR=SPLIT+1:LCC=1 
  51. 510     REM Set initial values for displayed char 
  52. 520 U=100:L=100 
  53. 530     REM Position cursor to print first char on upper screen 
  54. 540 LOCATE UCR,UCC 
  55. 550     REM Print it without carrige return 
  56. 560 PRINT U; 
  57. 570    REM Save this cursor pos for next char on upper scrn 
  58. 580 UCR=CSRLIN:UCC=POS(0) 
  59. 590    REM If next pos is on lower boundry then scroll text up to make room 
  60. 600 IF UCR>SPLIT-1 THEN CALL SCROLLR (UULR%,UULC%,ULRR%,ULRC%,UATTR%,ULENGTH%):UCR=SPLIT-1:U=U+1 
  61. 610    REM Then move cursor up one line into newly vacated line 
  62. 620    REM Same as above but for lower window 
  63. 630 LOCATE LCR,LCC:PRINT L;:LCR=CSRLIN:LCC=POS(0):IF LCR>23 THEN CALL SCROLLR (LULR%,LULC%,LLRR%,LLRC%,LATTR%,LLENGTH%):LCR=23:L=L+1
  64. 640    REM Run until any key hit then list to play around again!
  65. 650 X$=INKEY$:IF X$="" THEN 540 ELSE LIST
  66. 
  67. :LCR=23:L=L+1