Stata 15 help for local

[P] macro -- Macro definition and manipulation

Syntax

global mname [=exp | :extended_fcn | "[string]" | `"[string]"']

local lclname [=exp | :extended_fcn | "[string]" | `"[string]"']

tempvar lclname [lclname [...]]

tempname lclname [lclname [...]]

tempfile lclname [lclname [...]]

local { ++lclname | --lclname }

macro dir

macro drop { mname [mname [...]] | mname* | _all }

macro list [ mname [mname [...]] | _all ]

macro shift [#]

[...] `expansion_optr' [...]

where expansion_optr is

lclname ++lclname lclname++ --lclname lclname-- =exp :extended_fcn .class_directive macval(lclname)

Description

global assigns strings to specified global macro names (mnames). local assigns strings to local macro names (lclnames). Both double quotes (" and ") and compound double quotes (`" and "') are allowed; see quotes. If the string has embedded quotes, compound double quotes are needed.

tempvar assigns names to the specified local macro names that may be used as temporary variable names in a dataset. When the program or do-file concludes, any variables with these assigned names are dropped.

tempname assigns names to the specified local macro names that may be used as temporary scalar or matrix names. When the program or do-file concludes, any scalars or matrices with these assigned names are dropped.

tempfile assigns names to the specified local macro names that may be used as names for temporary files. When the program or do-file concludes, any datasets created with these assigned names are erased.

macro manipulates global and local macros.

The macro expansion operators expansion_optr are documented in [P] macro and [P] class. class_directive is any reference to an ado-class member variable or function; see [P] class for more information on ado classes.


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index