It's probably because you have "gosub" after "gosub" with no "return" anywhere.
Here's what your code is doing:
gosub edit <-(at the top)
The next two lines repeat forever...
gosub redo <-(when it sees B)
gosub edit <-(in redo)
It needs to be like this:
gosub edit <-(at the top)
return <-(when it sees B)
Also you can get rid of the need to check for a lowercase letter by using the "upper$()" command.
This is your code snip (edited to work on it's own with changes):
randomize timer()
imageview4=1
imageid3=1
MaxImage=20
` Make and get images
for t1=1 to MaxImage
ink rgb(rnd(255),rnd(255),rnd(255)),0
for t2=1 to 100
dot rnd(100),rnd(100)
next t2
get image t1,0,0,100,100,1
next t1
ink rgb(255,255,255),0
` Main Loop
do
gosub edit
loop
edit:
tim=timer()
do
cls
if imageview4=1
for a = 1 to 3000
if sprite exist(a) = 1 then delete sprite a
next a
paste image imageid3,1,10
endif
text 1,120,"Image Number = "+str$(imageid3)
text 1,200,"P>aste Image"
text 1,300,"V>iew Another Image"
text 1,400,"B>ack to Editor"
a$=inkey$():a$=upper$(a$)
if a$<>"" and timer()>tim+100
tim=timer()
if a$ = "P"
imageview4 = 0
paste image imageid3,300,300
wait 100
endif
if a$ = "V"
imageview4 = 1:imageview1 = 1
inc imageid3
if imageid3>MaxImage then imageid3=1
endif
if a$ = "B"
imageview4=0
return
endif
endif
loop
Edit: UFO beat me.