help for init

init

- A module to initialize STATA dofiles that leverages project functionality to track dependencies of Input/Outputs and achieve efficient compilation of large projects.

init performs a clear all and discard commands. It can set as working directory the directory of the current dofile if used in conjunction with project,
or change working directory to any other directory that the user user choses. init can open a log file (storing by default the logfile in the "./log/" folder, if it exists).
It can also turn on and off project functionality. project tracks dependencies of Input/Outputs and thus helps find bugs in the order
of execution of dofiles in a project. project can also help speed the compilation of large projects by avoiding unnecessarily executing code. You may want to turn
off this functionality to avoid having to run the entire project, and instead compile a single dofile. We call this "debug mode".

init
[,
debug debroute(string) double hard
ignorefold logfile(string) omit
proj(string) route(string)]

where

debug adds global deb "debug".

debroute Changes working directory with respect to project root directory, if debug is selected.
debroute should be used when multiple users are working simultaneously on the same root directory (for example, when multiple users
share a server and have access to a shared folder)

double adds type double option to STATA.

hard clears all macros --including globals. hard overrides debug.

ignorefold Unless ignorefold is selected, init checks whether log folder exists in root directory, and stores logfile there.

logfile opens a logfile if debug is not specified. Tip: pexit ado file closes all open logfiles.

omit skips creation of graphs when used in conjunction with twowayscatter ado file.

proj use it to pass the name of the current project (uses project functionality).

route: project changes the working directory to the current dofile that is compiling. route changes the working directory back if the user choses to do so.

This ado file does the following:

clear all
discard

Examples

Initialize a STATA dofile, pass project functionality and link to project "auto"

. init, proj(auto) route("../..")

. rest of the code

Use debug mode to compile a single dofile instead of the entire project. Also, turn off project functionality entirely.

. init, proj(auto) route("../..") debug

. rest of the code

init is intended to be used in conjunction with project, pexit, psave and puse.
Note that init creates global variables "deb" and "omit" and might overwrite existing macros with the same name.

This is open source software distributed under the GPL-3 license. Ownership belongs to their respective authors.
For more documentation, examples and the most up to date code visit https://github.com/economic-research/open-ado/
This version is as at least as recent as commit: 3cd38782bb154133078fb2cd597d774dbda1c4e3

Author

Andres Jurado

jose_jurado_vadillo@brown.edu