Stata Display
-display- prints text to the output.
Contents
Usage
display "Hello, world"
// arithmetic
display _N+1
// scalars
display "There are " _N " cases"
// stored results
display "Something about `r(N)' of them"
// macros
display "Something about ${globals} and `locals'"
Directives
-display- interprets a set of directives.
_newline prints a newline character
_newline(N) prints N newlines
_continue suppresses the automatic newline character at the end
_skip(N) moves the cursor forward N characters, effectively printing N space characters.
_char(N) prints the character corresponding to ASCII or Windows-1252 codepoint N. This is useful for showing characters that would otherwise need to be escaped, or for Windows-1252 codepoints that should instead be encoded in Unicode for display.
_column(N) moves the cursor to the Nth columnar position. Column positions index from 1.
Styles
-display- operates in styles. By default, it does not reset the style, so it may be necessary to begin a program's output like:
display as text ...
The other styles are:
result (bold)
error (red)
