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

st: Re: What is wrong with this syntax?

From   "Michael Blasnik" <>
To   <>
Subject   st: Re: What is wrong with this syntax?
Date   Sat, 21 Jul 2007 15:42:08 -0400


You need to -tokenize- your varlist to get them properly into local macros 1,2,3,etc.. Otherwise, 1,2,3 will hold command line "tokens" which will include adjacent commas.

Michael Blasnik

----- Original Message ----- From: "Kyle Hood" <>
To: <>
Sent: Saturday, July 21, 2007 2:50 PM
Subject: st: What is wrong with this syntax?

I have attempting to write a command (in version 8), with the following syntax:

program hhk, eclass
syntax varlist(min=3 max=3)[, P(real 0.5)]
di "`1'"
di "`2'"
di "`3'"

If I use the following call:

. hhk a b c, p(0.3)

I get an error (when I first try to use variable c), and the program displays


Why is it picking up the comma in the third variable? It doesn't do that for built-in stata commands.

*   For searches and help try:

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