I think mrHandy means something like this:
set display mode 1024,768,32,0,1,0
sync on : sync rate 30
color backdrop rgb(240,240,240):Autocam Off
ink rgb(0,0,0),1
set ambient light 100
color ambient light rgb(255,255,255)
load image "texture.jpg",1
make object plane 1,image width(1),image height(1)
texture object 1,1
z=500
do
set cursor 0,0
print "use arrows [up, down] to change z position"
print "z = ",z
print "use [c] to clamp the edges"
if upkey()=1 then z=z+1
if downkey()=1 then z=z-1
if inkey$() = "c" then set object texture 1, 2, 1
position object 1,0,0,z
sync
LOOP
end