lua-users home
lua-l archive

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

> You have raised an interesting point there as well. Lua is designed as an
> embedded language but the way it outputs text is not very convenient for
> systems which can't trap the standard streams. ie. Windows (unless I'm
> missing something). You have to go through the Lua code and alter every
> printf, fprintf etc. to redirect the output to your buffer.

The print facility I was talking about is done simply by registering a
C function in the lua environment (lua_OutPrint) and setting the global
'print' to point to the registered C function.  Although, I agree that
a central 'lua_Print' facility that is used *internally* by lua to print
stuff out would be groovy.

I also catch errors (and parse the passed in string to pull out the error 
information so I can print it out like I like).  

Please note that WinLua is very basic.  It was born because I was tired of
the command line tool.  So, it is pretty basic.  Umm... "a real handyman's