Difference is a FUNCTION returns a value, and a SUB doesn’t.
Some existing examples:
FUNCTIONS: COS(), SIN(), _PRINTWIDTH(): _FONTHEIGHT()
SUBS: CLS, PRINT, BEEP, SLEEP
Think of the difference in how you use the above commands:
CLS
x = SIN(.5)
Y = COS(.5)
PRINT x, y
With CLS you’re calling an internal routine which clears your screen. It just does something, and doesn’t return any values for you. SIN and COS, however, do something with the value you give them (.5, in this case), and they return that result to you (as x and y, respectively, in this case). PRINT, once again, just does something, but doesn’t return any values for you.
FUNCTIONS do something, then return a value to you.
SUBS simply do something, with no value returned after.