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

st: RE: file wrote single opening quote


From   Roger Newson <[email protected]>
To   [email protected]
Subject   st: RE: file wrote single opening quote
Date   Mon, 18 Nov 2002 22:11:03 +0000

At 21:40 18/11/02 +0000, Nick Cox wrote (re Ulrich Kohler's comments):

All this doesn't stop me wanting, like
I guess all others in this thread, to
be able to specify within Stata that I
want to read a line of text from a
file and/or to write a line of text to a
file absolutely as is with no interpretation
of macros. That is, the desire is for something
like

file lread  handle [specs]

file lwrite handle [specs]

where -lread- and -lwrite- indicate something
like a _l_iteral read and write.

I don't know exactly how easy that is to
do, but it is easy to ask for.
Nick doesn't specify what -lread- is going to read the line to, if not to a macro, or what -lwrite- is going to write the line from, if not from a macro. Presumably, this would be specified in the [specs]. However, IMHO a macro is probably the best place to store a line, just as long as there is a way of accessing the value of a macro without quoting anything. I still think the way to go is probably something like the macro substring functions -lsubstr(localmacroname,startaddress,length)- and -gsubstr(glocalmacroname,startaddress,length)- that I proposed in a previous thread, together with corresponding extended macro functions of the same names, and probably an extended macro function for the length of a macro value. However, like Nick, I only know how easy these things are to ask for, not how easy they are for StataCorp to implement in Stata.

Roger


--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: [email protected]

Opinions expressed are those of the author, not the institution.

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