lua-users home
lua-l archive

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


Jeffrey Drake wrote:
I am told what I am after is the equivalent to __LINE__ in C.

The idea is so the output might be something like this:

Message(myTest.lua: 45):   Task completed

or in more useful info:
Error(blah.lua:39): Expected list got string

You can have your special print/error function use the debugging
API to pull this information out of the stack at print-time -- that's
what I do.  Alternatively you can probably just actually pass your
lua files through the C preprocessor and __LINE__ and __FILE__
will magically do the right thing -- haven't tried that though.

Regards,
--Adam
--
Adam D. Moss   . ,,^^   adam@gimp.org   http://www.foxbox.org/   co:3