_virf_nlen.ado

来自「是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到」· ADO 代码 · 共 42 行

ADO
42
字号
*! version 1.0.2  07nov2002
program define _virf_nlen, rclass
	version 8.0
	syntax anything(name=name)

	local words : word count `name'
	if `words' > 1 {
		di as err "`name' is not a valid name"
		exit 198
	}

	capture confirm name `name'
	if _rc > 0 {
		di as err "`name' is not a valid name"
		exit 198
	}	

	local tmp : subinstr local name " " "" , /* 
		*/ count(local n1)

	if `n1' > 0 {
		di as err "`name' is not a vaid irfname"
		exit 198
	}	
	
	local n = length("`name'")
	if `n' > 24 {
		di as err "`name' is not a vaid irfname"
		exit 198
	}	
	
	ret scalar len = `n'
end

exit

_virf_nlen <name>
	
	checks that the specified name is valid and returns the length of
	valid names in r(len)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?