So, what's the difference between a function, and a sub routine?
The difference between a sub and a function is this: Funtions return a value, Subs don't.
Substring() is a Function, because you want some sort of answer back, and an answer that you can then use elsewhere. 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 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.
-Rasmus Iversen
No comments:
Post a Comment