Statalist The Stata Listserver


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

st: RE: Having troubles with Comments on a line


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Having troubles with Comments on a line
Date   Thu, 14 Dec 2006 23:16:22 -0000

Please don't send HTML to the list. It
should be trapped; it sometimes isn't. 
This is explained in the FAQ. 

Interactively, a beginning * indicates a comment. 

/* */ or // or /// don't work interactively. They 
are intended for programs or do files. 

-help comments- documents this, although it is 
not completely explicit. [U] 16.1.2 
makes it absolutely clear, however. 

I don't know why you expect otherwise; you give
no precise references for your claims. If you can 
give a precise reference to any documentation that turns
out to be unclear or wrong, then StataCorp no doubt 
endeavour to improve matters. 

Nick
[email protected] 

t.w.brundage

I am working with Stata 9/SE in Windows XP, Home Edition, Version 2002, SP 2.
Stata is up-to-date (executable updated 21Nov2006; ado updated 30Nov2006).

I am trying to include comments the interactive session which is being captured in
a logfile that will be used to create a do-file for the final presentation. If I start a
line with "*", the line is ignored. If I use the "/* . . . */" combination anywhere in the 
line, I get an error message. If I use "//" at the beginning of the line, I get and error
message. [Please see below]

With the exception to the "*" at the start of a line, this is contrary to what I expect.
The FAQ and prior items on Statalist suggest that what is happening is not to be 
expected.

In the material below, I first try to make a comment with the /* */ pair 
and got an error message.
Given the error, I tried again with just the * at the start of the line which worked.
Then I tried the // at the beginning of the line, and got an error message.
The next on repeats the // but there is a blank space as the first character in the line; 
an error message again.
The I tried the /* */ pair with a blank space as the first character on the line;
an error message again.
I then -sysuse-d the auto data, listed a few variables then tried to comment out
one of the variables on the line and an error message is back, but different this time!

My sessions always start with profile.do with the following commands:

autolog using default, path(c:\data9\logfiles)
noisily di 
noisily di "This session began at: $S_TIME on: $S_DATE"
noisily di  
pwd
ls *.dta

============= <code and messages inserted> ============= 
This session began at: 13:59:29 on: 14 Dec 2006

. /* begin non-survey analysis examples */
unrecognized command:  / invalid command name
r(199);

. * begin non-survey analysis examples

. // test
unrecognized command:  / invalid command name
r(199);

. // test
unrecognized command:  / invalid command name
r(199);

. /* test */
unrecognized command:  / invalid command name
r(199);

. sysuse auto
(1978 Automobile Data)
. list make price mpg rep78 in 1/10
     +--------------------------------------+
     | make             price   mpg   rep78 |
     |--------------------------------------|
  1. | AMC Concord      4,099    22       3 |
  2. | AMC Pacer        4,749    17       3 |
  3. | AMC Spirit       3,799    22       . |
  4. | Buick Century    4,816    20       3 |
  5. | Buick Electra    7,827    15       4 |
     |--------------------------------------|
  6. | Bui! ck LeSa bre    5,788    18       3 |
  7. | Buick Opel       4,453    26       . |
  8. | Buick Regal      5,189    20       3 |
  9. | Buick Riviera   10,372    16       3 |
 10. | Buick Skylark    4,082    19       3 |
     +--------------------------------------+
. list make price /* mpg */ rep78 in 1/10
/ invalid name
r(198);
. log close
       log:  c:\data9\logfiles\class_notes_3.log
  log type:  text
 closed on:  14 Dec 2006, 14:04:19
--------------------------------------------------------------------------------------------------------

============= <end of insert> ============= 


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