last_key as integer
shot_no as integer
file_name as string
do
if scancode() = 31 and last_key <> scancode()
`s key pressed
repeat
inc shot_no
file_name = "shot"+shot_no_tostring(shot_no)+".bmp"
until file exist(file_name) = 0 or shot_no > 999
if image exist(1) then delete image 1
get image 1,0,0,screen width(),screen height(),1
save image file_name,1
endif
last_key = scancode()
cls
text 0,0,"Press s to save image"
text 0,15,"last saved image: "+file_name
loop
function shot_no_tostring(i as integer)
local s as string
s = ""
if i <10 then s = s + "0"
if i < 100 then s = s + "0"
s = s + str$(i)
endfunction s
dbpro : 2ghz p4m : 512mb : geforce 4 4200 go