Functions return a value, and Subs don't.
Substring() is a Function, because you want some sort of answer back. You assign the answer to the Substring() function to a variable.
A Sub is some code or job that you want VB to get on with it and execute. An example is closing a form down and unloading it with Me.Close(). You don't need to return a value, here; you just want VB to close your form down.
Asked In: Many Interviews |