home *** CD-ROM | disk | FTP | other *** search
- Windowing in Basic
-
- Davie Reed
- Indianapolis Users Group
-
- I love to play with "windows". A
- window is an area of screen that has
- its own independent scrolling action
- while everything outside of this
- window area remains still.
-
- VisiCalc is a perfect example of a
- program that uses windows. The
- left-hand side of the screen always
- shows the current Y coordinate, and
- the top always shows your commands.
- When I first purchased my IBM PC I
- didn't realize that it couldn't do
- windows with BASIC.
-
- I was able to write machine language
- routines to control windowing from
- DOS, but couldn't get them to work
- BASIC. Finally, I remembered that on
- an Apple there were certain locations
- used to keep track of the sides of
- windows. After some searching in the
- IBM BASIC work area, I found the
- following window control locations:
-
- LOCATION PURPOSE
-
- POKE 41 Controls Right Side
- POKE 91 Controls Top Side
- POKE 92 Controls Bottom Side
-
- To use these pokes in BASIC, you must
- first "DEF SEG". Here is an example
- of a program that scrolls the middle
- of the screen, but leaves the top
- three lines and bottom six lines
- alone.
-
- 10 def seg
- 20 cls
- 22 locate 3,1: print "this will stay
- here"
- 25 locate 20,1: print "this will stay
- here also"
- 27 locate 15,1: print "this will
- scroll up"
- 30 poke 91,4 : poke 92,19
- 40 for x = 1 to 40 : print "hello
- there" : next
- 50 end