My opinion is that you are writing too much code.
Here is a simple example of a scroll window:
sync on
`make an array with strings
items = 19
dim string$(items)
for i = 1 to items
string$(i) = str$(i * 10)
next i
`set variables
posx = 20
posy = 50
sizex = 150
sizey = 200
`the scroll var
sy = -10
`the loop
do
`clear screen
cls
`main window
ink rgb(255,255,255),0
box posx,posy,posx+sizex,posy+sizey
ink rgb(0,0,255),0
box posx+1,posy+1,posx+sizex-1,posy+sizey-1
`display all data
for data = 1 to items
texty = sy + data * 18
if texty>5 and texty<sizey-12
ink rgb(255,255,255),0
text posx + 5, posy + texty, string$(data)
endif
next data
`make scroll buttons
if button(posx+sizex-10,posy+10,"^") > 0 then inc sy
if button(posx+sizex-10,posy+sizey-10,"v")>0 then dec sy
sync
loop
function button(x,y,text$)
pressed = 0
tx=text width(text$)
ty=text height(text$)/2
if mousex()>x and mousex()<x+tx
if mousey()>y-ty and mousey()<y+ty
pressed = 1
endif
endif
if pressed=1 then ink rgb(255,0,0),0 else ink rgb(255,255,255),0
text x,y-ty,text$
if pressed = 1
pressed = mouseclick()
else
pressed = 0
endif
endfunction pressed
If you have any questions, just ask...
Immunity and Annihalation makes Immunihalation...