lua-users home
lua-l archive

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


I've implemented an in-game lua console in my 2D sidescroller, and
successfully exposed certain functions to the environment.  When the user
types text and hits enter, lua_dostring is invoked.  I can show return
values from the stack, but what about console print for statements like

table.foreach(_G,print)

to show all the global variables?  How do I go about capturing the output
from print to show in my in-game console?  Do I need to reroute the cout or
cerr streams?

-Kevin Watters