18 Programming Stata
Contents
18.1 Description
18.2 Relationship between a program and a do-f i le
18.3 Macros
18.3.1 Local macros
18.3.2 Global macros
18.3.3 The difference between local and global macros
18.3.4 Macros and expressions
18.3.5 Double quotes
18.3.6 Extended macro functions
18.3.7 Macro increment and decrement functions
18.3.8 Macro expressions
18.3.9 Advanced local macro manipulation
18.3.10 Advanced global macro manipulation
18.3.11 Constructing Windows f i lenames by using macros
18.3.12 Accessing system values
18.3.13 Referring to characteristics
18.4 Program arguments
18.4.1 Named positional arguments
18.4.2 Incrementing through positional arguments
18.4.3 Using macro shift
18.4.4 Parsing standard Stata syntax
18.4.5 Parsing immediate commands
18.4.6 Parsing nonstandard syntax
18.5 Scalars and matrices
18.6 Temporarily destroying the data in memory
18.7 Temporary objects
18.7.1 Temporary variables
18.7.2 Temporary scalars and matrices
18.7.3 Temporary f i les
18.8 Accessing results calculated by other programs
18.9 Accessing results calculated by estimation commands
18.10 Storing results
18.10.1 Storing results in r()
18.10.2 Storing results in e()
18.10.3 Storing results in s()
18.11 Ado-f i les
18.11.1 Version
18.11.2 Comments and long lines in ado-f i les
18.11.3 Debugging ado-f i les
18.11.4 Local subroutines
18.11.5 Development of a sample ado-command
18.11.6 Writing system help
18.11.7 Programming dialog boxes
18.12 Tools for interacting with programs outside Stata and with other languages
18.13 A compendium of useful commands for programmers
18.14 References
1