I have a large TCL script, currently 2,774 lines. This is expected to continue to get longer with time. I have decided to split this into several files. The script consists of a header that branches into one of two if statements that contain a lot ofcode. Following this is a creation of dictionary that has a few hundred lines of code. Following this is a lot of procedures that rely on the dictionary and few other variables created at start of script.
Thus, start
(1) Declare "environment variables" that tell script what part to execute in first 1/4 as form of init/setup routine
(2) Code that performs init/setup function based on values it gets from (1) (3) Create a massive dictionary that is basically a mapping between name and integers
(4) A whole lot of procedures that do different things and can be grouped into what part of system they affect
(5) A final procedure that does some setup before the script ends
Once the script is executed in the TCL terminal, I then call the loaded procedures as required. Now my question is, what options exist for me to split this into smaller files and how will these pieces be brought together when the script is loaded?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 11:17:47 |
Calls: | 6,645 |
Calls today: | 5 |
Files: | 12,190 |
Messages: | 5,326,618 |