to define a subrouting you need a label like when you use goto.
from the dbpro help
Quote: "The label can be made up from any combination of alphabetic characters, but you must end the declaration of the label using a colon ":". You only need to use a colon when you are declaring the label, and should not be used when calling the label from a GOSUB command."
So basically a label is any combination of letters and numbers that ends in a ":".
i as integer
do
cls
gosub _add
text 0,0,str$(i)
loop
_add:
i = i+1
return
Functions are quite well explained in Hamish McHaggis tutorial that you can download from
here.