If you need to execute some code without a return value then use a Sub Procedure. If you expect the function to return a calculated value or maybe a boolean value indicating success or failure then use a function procedure. Pretty straight forward.
"Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'."