Hi Statalist!
I am writing two commands that I intend to publish in a single package on SSC. These two commands will share a lot of functionality and code, and I would like to know if someone has a suggested best practice for this.
I do not want to copy and paste code between the two .ado files for the two commands, as it will make maintaining and updating the commands very error prone and time demanding. I want to write the sub-functions at one place in one file and have both these commands to be able to call all those sub-functions. What is the Stata/SSC best practice related to this?
I know that additional files can be added to the package published on SSC, but what do I need to think of in order to have the two commands be able to call functions from that third file? I would prefer to not have one extra file per sub-functions as there will be many of them.
Thanks for any advice!
Kristoffer
I am writing two commands that I intend to publish in a single package on SSC. These two commands will share a lot of functionality and code, and I would like to know if someone has a suggested best practice for this.
I do not want to copy and paste code between the two .ado files for the two commands, as it will make maintaining and updating the commands very error prone and time demanding. I want to write the sub-functions at one place in one file and have both these commands to be able to call all those sub-functions. What is the Stata/SSC best practice related to this?
I know that additional files can be added to the package published on SSC, but what do I need to think of in order to have the two commands be able to call functions from that third file? I would prefer to not have one extra file per sub-functions as there will be many of them.
Thanks for any advice!
Kristoffer
Comment