Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: RE: troubleshooting positional arguments


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: troubleshooting positional arguments
Date   Sat, 28 Apr 2012 11:17:21 +0100

I think Phil has hit the nail on the head. Incidentally, note that

local y `1'
local w `2'
local x `3'

could be replaced by

args y w x

Nick

On Sat, Apr 28, 2012 at 3:30 AM, Philip Ryan
<philip.ryan@adelaide.edu.au> wrote:
> Laszlo
>
> On my screen, the right single quote after 3 in this line:
>
> local x `3’
>
> appears to be a different character from the right single quotes delimiting the other positional macros.
>
> Phil
>
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of László Sándor
> Sent: Saturday, 28 April 2012 10:32 AM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: troubleshooting positional arguments
>
> Dear all,
>
> I hope I am just missing the obvious, but please help me why the code below does not parse the third argument after a tokenize. I am pretty sure I am doing standard things here. The relevant part of the trace follows.
>
> - tokenize `varlist'
>  = tokenize y t psc
>  - error ("`4'"!="" & "`psc'"!="")
>  = error (""!="" & "psc"!="")
>  - local y `1'
>  = local y y
>  - local w `2'
>  = local w t
>  - local x `3’
>  - ereturn clear
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index