|
⇤ ← Revision 1 as of 2025-03-05 20:23:39
Size: 606
Comment: Initial commit
|
← Revision 2 as of 2025-10-24 17:49:28 ⇥
Size: 580
Comment: Rewrite
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 3: | Line 3: |
| The '''`ubav`''' command un-abbreviates Stata names. | '''`-ubav-`''' un-abbreviates names. |
| Line 23: | Line 23: |
| The `unab` command parses abbreviated names and sets a local macro with the un-abbreviated equivalent. | `-unab-` parses abbreviated names and sets a local macro with the un-abbreviated equivalent. |
Stata Unab
-ubav- un-abbreviates names.
Contents
Usage
Given a macro defined like var1 var2 var3, it is possible to write syntax like:
foreach var of local list {
display "`var'"
}This is not possible with a macro defined like var1-var3, i.e. a variable list that needs to be expanded.
-unab- parses abbreviated names and sets a local macro with the un-abbreviated equivalent.
unab newlist: `list'
foreach var of local newlist {
display "`var'"
}