Statalist


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

Re: st: Re: Pass Integers to Program


From   "Michael Blasnik" <michael.blasnik@verizon.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Re: Pass Integers to Program
Date   Mon, 18 Feb 2008 08:52:33 -0500

....
Thanks for the correction -- I forgot the exact syntax (guess I should have read the on-line help before posting...).

Michael

----- Original Message ----- From: "Maarten buis" <maartenbuis@yahoo.co.uk>
To: <statalist@hsphsun2.harvard.edu>
Sent: Monday, February 18, 2008 2:16 AM
Subject: Re: st: Re: Pass Integers to Program



--- Michael Blasnik <michael.blasnik@verizon.net> wrote:
It would be easiest to make this a "required" option because you
could then use the numlist syntax.

syntax ..., values(numlist min=1 max=49 integer ascending)
Very true, but min and max here refer to the number of element, so you
will want to fix those at 6, and the range is governed by > and <. So
to require everybody to give a list of 6 integers between 0 and 50
(exclusive) and to sort those numbers you type:

syntax ... , values(numblist min=6 max=6 >0 <50 sort integer)

This way the block of code Michael added for checking the number of
elements in `values' becomes unnecesary.

Hope this helps,
Maarten
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index