Quote: "I can't recall the last time I used gosub. I strictly use functions.
"
Just to add my tuppence, having used (Microsoft) Visual Basic 6 for 12 years in the past, I NEVER EVER used the GOSUB or GOTO command. It was considered bad programming practice, even 15 years ago.
The rules for using the GOSUB in VB6 are :
* The destination of a GoSub statement must be a line label or line number that resides within the same Sub or Function procedure as the statement that issues the GoSub (i.e., you cannot "GoSub" to a line in a Sub or Function other than the one you are currently in). In effect, using GoSub lets you have "subs within a sub" (with the exception that you cannot pass parameters to a "GoSubbed" routine).
* If a line label is used, the name of that line label must follow the same rules as that for naming a variable. The line label must begin in the first column of the line and must be followed by a colon":".
* If a line number is used, it must begin in the first column of the line.
* Once the destination of the GoSub is reached, a Return statement will return control to the statement after the one that issued the GoSub.
As the first point says a GOSUB should only be used within a function, if at all.
Functions is the way to go, and as mentioned previously definitely multiple code files.
If you need to call a number of functions at certain points then put them in a function (with a meaningful name) and call that function.
IMHO
Of all the things I've lost, it's my... my... oh darn it.