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

st: parsing problem

From   Federico Belotti <[email protected]>
To   StataList <[email protected]>
Subject   st: parsing problem
Date   Thu, 07 Jan 2010 14:35:49 +0100

*Dear all,

I've the following parsing problem in writing one of my ado's:

I need that option's argument be returned just as the user typed them, with quotes and with leading and trailing blanks. So, I use:

prog define example
syntax, OPTION(string asis)

*and when I type:*

example, option(1 "example")

*I get what expected, that is:*

di `"`option' " '
1 "example"

*Then I perform some tasks. At some point of the code I need to strip off double quotes from the local option. I tried without success with:*

1) local new_option: subinstr local option """ "", all
2) local new_option =  regexr(`"`option' " ', """, "")
3) local new_option: list clean option

*Can someone help me?



Federico Belotti
Faculty of Economics
Department of Financial and Quantitative Economics
Tor Vergata University
tel: +39 06 7259 5624/25
e-mail: [email protected]

*   For searches and help try:

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