Statalist The Stata Listserver


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

Re: st: Behaviour of -tokenize- shouldn't it drop the parsing character?


From   "David Elliott" <dcelliott@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Behaviour of -tokenize- shouldn't it drop the parsing character?
Date   Fri, 6 Oct 2006 09:58:35 -0300

Bill

Thank you for your example and detailed explanation of what is going
on in each of the steps.  I am sure this will be helpful not only to
me, but to the larger Statalist community as well.

I am still wrapping my head around:
"The -while- statement says, "assign to l the value of strpos(...);
        while l is not equal to zero"."
but when I've done so, I think I will have learned a new trick.  I
haven't yet explored Mata and it appears to be more "conventional" in
the way it references macros vs. the quote conventions that we both
love and hate in writing ados, especially when dealing with complex
strings containing their own quote combinations that can trip up macro
expansion.  May I infer that such problems would not occur in Mata?

This has been a good exercise for me since, courtesy of Nick, I have
learned about the c_local macro assignment command which I desperately
needed for another routine that had to leave behind some macros but we
didn't want to have them as globals.

You may have seen that I modified the SSC tknz command to address my
original problem (
http://www.stata.com/statalist/archive/2006-10/msg00203.html ), but I
will certainly look to Mata for solutions to similar situations in the
future.  Heh, what's one more programming language to learn, anyway?

And I still think tokenize should have a nochar option! eżo

DCE

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