Use my password program for an example of that. I separated main functions like encyting, decrypting, and changing the password into different subs rather than have it all in the main file and cluttering up my programming and making it harder to understand.
It should not be too hard to set it up. First you need to create the sub, then you need to declare it in the main sub. Then you will need to call the subs from the main sub when necessary. You will also be able to call the subs from other subs without having to define them in those subs as well.
Here is the code for defining the sub(taken directly from my password program):
Code:
DECLARE SUB Change ()
DECLARE SUB Encode ()
DECLARE SUB Decode ()
Then to call the subs use:
Code:
CALL Change
CALL Encode
CALL Decode
What you need to do now is copy and paste your other programs that were included and put them into subs. Give the subs reasonable names that reflect their functions and call them when the user wants to use them.