Using Subroutines
Use Arguments and the return value of the subroutine to save on having to work with the same variables inside the subroutine as outside the subroutine - makes them much more memory efficient and versatile
Subroutines can be made global or local
- Some people hate to make subroutines local, I think it makes sense to clean up after yourself, which is what making it local does
- If you need to leave a subroutine global, it is a good idea to give it a unique name. Most people use two or more letters of the program and a semi-colon before the name of the subroutine i.e.