11.07.2015 Views

[U] User's Guide

[U] User's Guide

[U] User's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

[ U ] 16.1 Description 183When running an old do-file that includes a version statement, you need not worry about settingthe version back after it has completed. Stata automatically restores the previous value of versionwhen the do-file completes.16.1.2 Comments and blank lines in do-filesYou may freely include blank lines in your do-file. In the previous example, the do-file could justas well have readbegin myjob.doversion 11use http://www.stata-press.com/data/r11/censustabulate regionsummarize marriage_rate divorce_rate median_age if state!="Nevada"end myjob.doThere are four ways to include comments in a do-file.1. Begin the line with a ‘*’; Stata ignores such lines. * cannot be used within Mata.2. Place the comment in /* */ delimiters.3. Place the comment after two forward slashes, i.e., //. Everything after the // to the end ofthe current line is considered a comment (unless the // is part of http://. . . ).4. Place the comment after three forward slashes, i.e., ///. Everything after the /// to the endof the current line is considered a comment. However, when you use ///, the next line joinswith the current line. /// lets you split long lines across multiple lines in the do-file.Technical noteThe /* */, //, and /// comment indicators can be used in do-files and ado-files only; you maynot use them interactively. You can, however, use the ‘*’ comment indicator interactively.myjob.do then might readbegin myjob.do* a sample analysis jobversion 11use http://www.stata-press.com/data/r11/census/* obtain the summary statistics: */tabulate regionsummarize marriage_rate divorce_rate median_age if state!="Nevada"end myjob.door equivalently,begin myjob.do// a sample analysis jobversion 11use http://www.stata-press.com/data/r11/census// obtain the summary statistics:tabulate regionsummarize marriage_rate divorce_rate median_age if state!="Nevada"end myjob.doThe style of comment indicator you use is up to you. One advantage of the /* */ method is that itcan be put at the end of lines:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!