in reply to alternative way to subs
The other monks have given you some good strategies for turning your programs into subs easily. I particularly like the modulino approach that Corion gave.
If you do turn these separate programs into subs, I think it's important also to think about how this changes the functionality.
If what you have now works, fine. I'd be worried about the future. This way of doing subroutines is probably going to lead to grief at some point (probably because of how you pass data in and out), and I wouldn't want to perpetuate it any longer than necessary. That is, don't write new code this way. As I work on old code that does this, I'd probably migrate it away, but I wouldn't go out of my way to fix what's not (yet) broken.
|
|---|