Sure. Simple example program:
`Basic setup
sync on : sync rate 0
color backdrop rgb(0,0,0)
`Create a sprite to test the program with
cls rgb(200,200,200)
get image 1,0,0,20,20
sprite 1,100,100,1
do
`Print directions
text 10,10,"Click to drag the sprite around."
text 10,30,"Press 's' to save the sprite's location."
text 10,40,"Press 'l' to load the sprite's location."
`Check for key presses and load/save the file appropriately
if inkey$()="s" then SaveSpriteLocation(1,"spritecoords.dat")
if inkey$()="l" then LoadSpriteLocation(1,"spritecoords.dat")
`Drag the sprite around
if mouseclick()=1
if clicked=0
clicked=1
xoffset=sprite x(1)-mousex()
yoffset=sprite y(1)-mousey()
else
sprite 1,mousex()+xoffset,mousey()+yoffset,1
endif
else
clicked=0
endif
sync
loop
function SaveSpriteLocation(SpriteNo,file$)
`Create the save file
open to write 1,file$
`Write the sprite's coordinates to the save file
write string 1,str$(sprite x(SpriteNo))
write string 1,str$(sprite y(SpriteNo))
`Save and close the file
close file 1
endfunction
function LoadSpriteLocation(SpriteNo,file$)
`Open the file storing the coordinates
open to read 1,file$
`Read the coordinates
read string 1,tempx$
read string 1,tempy$
`Close the file
close file 1
`Position the sprite at the proper coordinates
sprite SpriteNo,val(tempx$),val(tempy$),sprite image(SpriteNo)
endfunction
Ask away if you have any questions about it.