Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: macro list limits strpos

From   Jakob Petersen <>
Subject   st: macro list limits strpos
Date   Fri, 20 Jan 2012 10:30:11 +0000


Problem: The following does not scale up to longer macro lists and variables at the end of longer macros are cut off.

sysuse auto,clear
findname,type(string) local(vstr)
findname,type(int) local(vint)
local vother : list vother - vstr
local vother : list vother - vint
di "`vstr'"
di "`vint'"
di "`vother'"
foreach v of varlist * {
if strpos("`vstr'","`v'") {
di "`v' is a string variable"
if strpos("`vint'","`v'") {
di "`v' is an integer variable"
if strpos("`vother'","`v'") {
di "`v' is not string nor integer variable"

Any ideas?
Similar to:

Tried increasing maxvar to no avail - is there away of increasing mem allocation here or is a different approach to -strpos- required?

Jakob Petersen

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index