Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: lines starting with * used as dereference operator in Mata are displayed as comments (Stata 12)


From   csfr1@eml.cc
To   statalist@hsphsun2.harvard.edu
Subject   st: lines starting with * used as dereference operator in Mata are displayed as comments (Stata 12)
Date   Fri, 31 Aug 2012 15:56:44 +0200

Hi there,

The Stata Do-file editor seems to misinterpret the * signs when used in Mata as dereference operators for pointers when they are a the beginning of a line.

For example, assume the following short program where pointer s refers to scalar a:

version 12
mata
a=3 // scalar a takes on value=3
p=&a // pointer p refers to scalar a
*p // dereferences p and displays value
end

The program works fine, but the line starting with * is wrongly displayed in green as if it were a comment in Stata.

I find this visually confusing. Any idea how to stop this?

BTW, Mata would not allow * at the beginning of a line to enter a comment (only //, /// and /* */ are allowed), and I reckon that this is precisely because it could be misinterpreted as a dereference operator.

My Stata version: Stata/SE 12.1 for Windows (64-bit x86-64), Revision 08 Aug 2012

Thanks for your help

Claudio Sfreddo
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index