1 Star 0 Fork 7

夏汉林/nwcommands

forked from 连享会/nwcommands 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
_nwsyntax.ado 1.63 KB
一键复制 编辑 原始数据 按行查看 历史
ThomasGrund 提交于 2015-09-18 19:13 . v1.5.1
*! Date : 10sept2014
*! Version : 1.1.0
*! Author : Thomas Grund, Linkping University
*! Email : contact@nwcommands.org
capture program drop _nwsyntax
program _nwsyntax
syntax [anything],[max(integer 1) min(passthru) nocurrent name(string) id(string)]
if ("$nwtotal" == "" | "$nwtotal" == "0") {
noi di "{err}No network found."
error 6001
}
if "`name'" == "" {
local name = "netname"
}
if "`nodes'" == "" {
local nodes = "nodes"
}
if "`networks'" == "" {
local networks = "networks"
}
if "`directed'" == "" {
local directed = "directed"
}
if "`id'" == "" {
local id = "id"
}
local netname = "`name'"
local netid = "`id'"
if "`anything'" == "" & "`current'" == ""{
nwcurrent
local anything = r(current)
}
capture nwunab _temp : `anything', max(`max') `min'
if _rc != 0 {
if _rc == 111 | _rc == 198 {
di "{err}network {bf:`anything'} not found"
error 6001
}
if _rc == 102 {
di "{err}`anything'"
di "too few networks specified"
error 6002
}
if _rc == 103 {
di "{err}`anything'"
di "too many networks specified"
error 6003
}
}
local networkscnt : word count `_temp'
local lastnet : word `networkscnt' of `_temp'
mata: st_rclear()
nwname `lastnet'
local netid = r(id)
//mata: _diag(nw_mata`netid', 0)
c_local `id' "`r(id)'"
c_local `netname' "`_temp'"
c_local `nodes' "`r(nodes)'"
c_local `name' "`_temp'"
c_local `directed' "`r(directed)'"
c_local `networks' "`networkscnt'"
mata: st_rclear()
end
*! v1.5.0 __ 17 Sep 2015 __ 13:09:53
*! v1.5.1 __ 17 Sep 2015 __ 14:54:23
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xiahanlin/nwcommands.git
git@gitee.com:xiahanlin/nwcommands.git
xiahanlin
nwcommands
nwcommands
master

搜索帮助