Or for safety, so it exits when you press escape:
circle 10,10,5
get image 1,0,0,16,16
cls
sprite 1,0,0,1
set sprite 1,1,1
sync on:sync rate 0
start:
esc = ESCAPEKEY()
WHILE esc = 0
ESC = ESCAPEKEY()
sprite 1,x,y,1
if upkey()=1 then y=y-5
if downkey()=1 then y=y+5
if leftkey()=1 then x=x-5
if rightkey()=1 then x=x+5
sync
ENDWHILE
IF esc = 1
EXIT
ELSE
GOTO start
ENDIF
The if statement defines what the escape key does, thus making it exit. By putting "esc = ESCAPEKEY()" before the while statement, if you hold in the escape key as the program starts, it'll just exit immediately.
Putting it in the while statement gives a way out of the loop.
Hang in there 8) You'll get the hang of it! Keep in mind, as well, that there are many languages out there, so if this one doesn't float your boat, consider what you don't like about it, and research one that you'll like. All languages have their pros and cons, so research well 8) Really, this is a great language for the beginner and intermediate alike... I'd say expert, too, but most of those guys already have routines that do everything in DBPro, since they have been coding so long before DBPro was around 8)