Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[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   [email protected]
To   [email protected]
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index