Statalist


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

st: RE: advantage of using #delimit ;


From   "Newson, Roger B" <r.newson@imperial.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: advantage of using #delimit ;
Date   Wed, 2 Jul 2008 20:10:50 +0100

I personally use
#delim ;
most of the time, because I write so many multi-line commands
(especially when drawing graphs), and I therefore find that remembering
to insert a ; at the end of each command involves less effort than
writing /// or /**/ at the end of each line that does not terminate a
command. Also, I got into the habit of writing ; at the end of commands
when programming in SAS or C. It is also possible to use the ; delimiter
to write multi-column lines, but I try not to write too many of these,
as they make the program less easy to read.

However, when writing Mata programs, I always type
#delim cr
before typing any Mata code, as Mata was designed to work in that mode.

However, the carriage return delimiter seems to be preferred by most
users, most of the time, especially people at StataCorp, who write the
ado-files of official Stata.

I hope this helps.

Roger


Roger B Newson
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: r.newson@imperial.ac.uk 
Web page: www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/pop
genetics/reph/

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

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Man Jia
Sent: 02 July 2008 19:02
To: statalist@hsphsun2.harvard.edu
Subject: st:advantage of using #delimit ; 

Dear statalists,

As to long lines in do-files, I know I can use #delimit ; to change the 
end-of-line delimiter to ';'. Or I can use /// or /**/comment indicator.

 So, I was wondering if there's any advantage of using #delimit ; 
instead of /// or /**/. I'm thinking  the first method means you have  
to type ; at the end of each line,while if I use the second way  I need 
to type /// or /**/ only when there are long lines. But I do have seen 
a lot of people prefer #delimit ;. Is there any reason for this?

Thanks for your time!

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

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