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

st: RE: Long arguments passed to programs


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Long arguments passed to programs
Date   Thu, 8 Jan 2004 10:07:33 -0000

First, and perhaps perversely, I'd recommend something
different. Why insist on commas? Why not recommend 
a space-separated list? (If names might include spaces, 
then they can be bound in quotes.) There are 
several arguments for this preference -- many of them 
are small points but in general I think space-separated
lists have the edge. 

Second, see help on -limits- or [R] limits. 

Nick 
[email protected] 

Michael Ingre
 
> I'm working on a program that will need to accept long 
> arguments to be
> parsed to the programs. Typically, an argument will be 
> several lists of
> names separated by a comma (","). The argument will then 
> the be tokenized
> into several sub-lists for further processing. This can 
> easily be done in
> Stata with strings passed as an argument and then 
> tokenized. However,
> strings has a limit (I think) of 244 characters.
> 
> program define longarguments
> syntax argument(string)
> 
> tokenize "`argument'" , parse(",")
> 
> ....
> ....  
> 
> 
> Is it possible to pass very long arguments (300-1000 
> characters) to a
> program on the commandline? And what is the maximum limit 
> of characters (or
> elements) a macro list can hold?
> 
> I think I read somewhere that a macro can hold very long 
> lists (like 32768
> characters or something) but now I can't find it in the manuals.

*
*   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