代码拉取完成,页面将自动刷新
同步操作将从 连享会/nwcommands 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
capture program drop _nwnodeid
program _nwnodeid
syntax [anything(name=netname)], nodelab(string) [detail]
_nwsyntax `netname'
mata: st_rclear()
mata: st_global("r(netname)", "`netname'")
mata: st_global("r(nodelab)", "`nodelab'")
capture confirm integer number `nodelab'
if _rc == 0 {
if `nodelab' > `nodes' {
mata: st_numscalar("r(nodeid)", -1)
di "{err}{it:nodelab} {bf:`nodelab'} out of bounds"
error 600021
}
mata: st_numscalar("r(nodeid)", `nodelab')
exit
}
else {
nwname `netname'
local labs "`r(labs)'"
mata: st_rclear()
mata: st_global("r(netname)", "`netname'")
mata: st_global("r(nodelab)", "`nodelab'")
local i = 1
local found = 0
capture foreach onelab in `labs' {
noi if "`onelab'" == "`nodelab'"{
mata: st_numscalar("r(nodeid)", `i')
local found = 1
di
if "`detail'" == "detail" {
di "{hline 40}"
di "{txt} Network: {res}`netname'"
di "{hline 40}"
di "{txt} Nodeid : {res}`r(nodeid)'"
di "{txt} Nodelab : {res}`r(nodelab)'"
}
exit 1
}
local i = `i' + 1
}
if `found' == 0 {
mata: st_numscalar("r(nodeid)", -1)
di "{err}{it:nodelab} `nodelab' not found"
error 6012
}
}
end
*! v1.5.0 __ 17 Sep 2015 __ 13:09:53
*! v1.5.1 __ 17 Sep 2015 __ 14:54:23
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。