[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Beware of Stata's Syntax

From   "Sergiy Radyakin" <>
To   "" <>
Subject   st: Beware of Stata's Syntax
Date   Thu, 22 May 2008 17:17:46 -0400

Dear All,

I wonder if this is an intended behaviour (quite dangerous from my
point of view) or just a bug?

// --- Begin of file ---

program drop _all
drop _all

generate VariableThatShouldNotBeUsed=.

program define SyntaxBug
    syntax [varname]
    di `"`varlist'"'	


generate JustAnotherVariable=.


// --- End of file ---

If this is not an intended behaviour then it is actually two bugs in
one, since under some conditions the program will process the variable
that the user DID NOT specify (first call in the program above), and
under other conditions it will refuse to work though it supposedly
should (second call in the program above).

If this is intended (may be there is an explanation) then it goes
against the documentation, saying anything in [ ] is optional.

Thank you,
    Sergiy Radyakin
*   For searches and help try:

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