home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / MISC / TNH_PC.ZIP / REED.NL < prev    next >
Encoding:
Text File  |  1987-01-14  |  1.5 KB  |  56 lines

  1. Windowing in Basic
  2.  
  3.               Davie Reed
  4.        Indianapolis Users Group
  5.  
  6. I love to play with "windows". A
  7. window is an area of screen that has
  8. its own independent scrolling action
  9. while everything outside of this
  10. window area remains still.
  11.  
  12. VisiCalc is a perfect example of a
  13. program that uses windows. The
  14. left-hand side of the screen always
  15. shows the current Y coordinate, and
  16. the top always shows your commands.
  17. When I first purchased my IBM PC I
  18. didn't realize that it couldn't do
  19. windows with BASIC.
  20.  
  21. I was able to write machine language
  22. routines to control windowing from
  23. DOS, but couldn't get them to work
  24. BASIC. Finally, I remembered that on
  25. an Apple there were certain locations
  26. used to keep track of the sides of
  27. windows. After some searching in the
  28. IBM BASIC work area, I found the
  29. following window control locations:
  30.  
  31. LOCATION   PURPOSE
  32.  
  33. POKE 41      Controls Right Side
  34. POKE 91      Controls Top Side
  35. POKE 92      Controls Bottom Side
  36.  
  37. To use these pokes in BASIC, you must
  38. first "DEF SEG". Here is an example
  39. of a program that scrolls the middle
  40. of the screen, but leaves the top
  41. three lines and bottom six lines
  42. alone.
  43.  
  44. 10 def seg
  45. 20 cls
  46. 22 locate 3,1: print "this will stay
  47.    here"
  48. 25 locate 20,1: print "this will stay
  49.    here also"
  50. 27 locate 15,1: print "this will
  51.    scroll up"
  52. 30 poke 91,4 : poke 92,19
  53. 40 for x = 1 to 40 : print "hello
  54.    there" : next
  55. 50 end
  56.