Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Suggestion for -confirm var- option


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Suggestion for -confirm var- option
Date   Sun, 14 Mar 2004 17:27:39 -0000

While you're waiting, here's one way round this: 

local v "car" 
unab vs : `v'* 
local exactmatch : list v in vs 

Nick 
[email protected] 

Kaleb Michaud
 
> I just spent some time trying to debug a program, when I 
> realized that the 
> -confirm var- command does not require the variable to be 
> spelled out fully.
> 
> For example, suppose you have a program that looks to see if 
> the variable 
> "car" exists.  If it doesn't, it creates or merges it in.  
> But, if I have a 
> variable called cartoon and not car in the data:
> 
> . confirm var car
> 
> gives us _rc == 0 even though the var car doesn't exist and 
> the var cartoon 
> does.  Any way that the Stata powers that be could add an 
> "exact" option 
> such that the varlist that it is confirming must have exact 
> variable syntax 
> provided?  I think this is often an issue when dealing with 
> varlists - I 
> know, just change the var names, but sometime this isn't an option.
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index