People -
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> =============
thomasb
thomas brundage