2016-08-04 32 views
1

在STATA help macro頁面底部附近是說where expansion_optr is,並列出了以下內容:如何在幫助宏中使用expand_optr?

  • ++ lclname
  • lclname ++
  • --lclname
  • = EXP
  • :ex tended_fnm
  • .class_directive
  • macval(lclname)

是任何人都知道的任何文件(超出在macro幫助文件時),其給出瞭如何使用這些一些例子操作?如果沒有好的文檔可以找到,任何使用宏expansion_optr的例子將是有益的。

回答

3

你是否研究了廣泛的備註和例子部分in the manual?您可以通過單擊幫助文件頂部的藍色[P] macro鏈接來訪問相同的條目。

下面是一些例子玩:

local i=0 
local j=0 
while `i'<= 1 { 
    di "Increment i=`i' immediately to get `++i'" 
    di " i is now `i'" 
    di "j=`j' plus 1 will be (`j++'+1) next time" 
    di " j is currently `j'" 
} 

sysuse auto, clear 
des price 
local label: variable label price 
di as red "price's label is `label'" 

它可以幫助您:

enter image description here