📄 set_defaults.ado
字号:
*! version 1.0.6 21mar2005
program set_defaults
version 8
cap noi syntax anything(name=sub id="set category") [, PERManently]
if _rc {
local rc = _rc
if _rc==100 {
cap noi Errmsg
}
exit `rc'
}
local l = length("`sub'")
if "`sub'"==substr("memory",1,max(3,`l')) {
Set_memory, `permanently'
}
else if "`sub'"==substr("output",1,max(3,`l')) {
Set_output, `permanently'
}
else if "`sub'"==substr("interface",1,max(5,`l')) {
Set_interface, `permanently'
}
else if "`sub'"==substr("graphics",1,max(2,`l')) {
Set_graphics, `permanently'
}
else if "`sub'"==substr("efficiency",1,max(3,`l')) {
Set_efficiency, `permanently'
}
else if "`sub'"==substr("network",1,max(3,`l')) {
Set_network, `permanently'
}
else if "`sub'"==substr("update",1,max(2,`l')) {
if `"`c(os)'"' != "Unix" {
Set_update, `permanently'
}
else {
di as err "-set_defaults update- not allowed on Unix"
exit 198
}
}
else if "`sub'"=="trace" {
Set_trace, `permanently'
}
else if "`sub'"=="mata" {
Set_mata, `permanently'
}
else if "`sub'"==substr("other",1,max(3,`l')) {
Set_other, `permanently'
}
else if "`sub'"=="_all" {
Set_memory, `permanently' // must be first
Set_output, `permanently'
Set_interface, `permanently'
Set_graphics, `permanently'
Set_efficiency, `permanently'
Set_network, `permanently'
if `"`c(os)'"' != "Unix" {
Set_update, `permanently'
}
Set_trace, `permanently'
Set_mata, `permanently'
Set_other, `permanently'
}
else Errmsg "`sub'"
if "`permanently'" != "" {
di as txt "(preferences set and recorded)"
}
else {
di as txt "(preferences reset)"
}
end
program Errmsg
args sub
di as err "{p 0 4}"
di as err `""`sub'" found where "memory", "output", "interface","'
di as err `""efficiency", "network", "update", "trace", "mata","'
di as err `""other", or "_all" expected"'
di as err "{p_end}"
exit 198
end
program Set_memory
syntax [, PERManently]
if c(flavor)=="Intercooled" {
if c(SE) {
Setcmd "matsize 400" `permanently'
Setcmd "maxvar 5000" `permanently'
Setcmd "memory 10M" `permanently'
}
else {
Setcmd "matsize 200" `permanently'
Setcmd "memory 1M" `permanently'
}
}
else {
di as txt ///
"(there are no settable memory settings in `c(flavor)' Stata)"
}
end
program Setcmd
args setargs perm
if "`perm'"=="" {
di as txt `"-> set `setargs'"'
qui set `setargs'
}
else {
di as txt `"-> set `setargs', permanently"'
qui set `setargs', permanently
}
end
program Set_output
syntax [, PERManently]
Setcmd "more on" `permanently'
Setcmd "rmsg off" `permanently'
Setcmd "dp period" `permanently'
di as txt "-> (linesize left at current value)"
di as txt "-> (pagesize left at current value)"
Setcmd "logtype smcl" `permanently'
end
program Set_interface
syntax [, PERManently]
if "`c(os)'" == "Windows" {
Setcmd "dockable on" `permanently'
Setcmd "dockingguides on" `permanently'
Setcmd "floatresults off"
Setcmd "floatwindows off"
Setcmd "locksplitters off" `permanently'
Setcmd "persistfv off"
Setcmd "persistvtopic off"
Setcmd "xptheme on" `permanently'
Setcmd "smalldlg off" `permanently'
}
Setcmd "linegap 1" /* has no permanently option */
Setcmd "scrollbufsize 32000" /* has no permanently option */
Setcmd "varlabelpos 32" /* has no permanently option */
Setcmd "reventries 100" `permanently'
Setcmd "maxdb 50" `permanently'
end
program Set_graphics
syntax [, PERManently]
if "`c(console)'"=="console" {
Setcmd "graphics off"
}
else Setcmd "graphics on"
Setcmd "scheme s2color" `permanently'
Setcmd "printcolor automatic" `permanently'
Setcmd "copycolor automatic" `permanently'
end
program Set_efficiency
syntax [, PERManently]
Setcmd "adosize 500" `permanently'
Setcmd "virtual off" /* no permanent option */
end
program Set_network
syntax [, PERManently]
Setcmd "checksum off" `permanently'
Setcmd "timeout1 120" `permanently'
Setcmd "timeout2 300" `permanently'
Setcmd "netdebug off" `permanently'
Setcmd "httpproxy off"
Setcmd `"httpproxyhost """'
Setcmd `"httpproxyport 8080"'
Setcmd "httpproxyauth off"
Setcmd `"httpproxyuser """'
Setcmd `"httpproxypw """'
end
program Set_update
syntax [, PERManently]
Setcmd "update_query on" /* no permanent option */
Setcmd "update_interval 7" /* no permanent option */
Setcmd "update_prompt on" /* no permanent option */
end
program Set_trace
syntax [, PERManently]
Setcmd "trace off"
Setcmd "tracedepth 32000"
Setcmd "traceexpand on" `permanently'
Setcmd "tracesep on" `permanently'
Setcmd "traceindent on" `permanently'
Setcmd "tracenumber off" `permanently'
Setcmd `"tracehilite """' /* no permanent option */
end
program Set_mata
syntax [, PERManently]
Setcmd "matastrict off" `permanently'
Setcmd "matalnum off" /* no permanent option */
Setcmd "mataoptimize on" /* no permanent option */
Setcmd "matafavor space" `permanently'
Setcmd "matacache 400" `permanently'
Setcmd `"matalibs "lmataado;lmatabase""' /* no permanent option */
Setcmd "matamofirst off" `permanently'
end
program Set_other
syntax [, PERManently]
Setcmd "type float" `permanently'
Setcmd "level 95" `permanently'
Setcmd "maxiter 16000" `permanently'
Setcmd "searchdefault local" `permanently'
di as txt "-> (seed left at current value)"
Setcmd "varabbrev on" `permanently'
end
exit
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -