[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Windows console
- From: Nick.Trout@...
- Date: Tue, 23 Jun 1998 17:18:39 +0000
That sounds great could you mail it to please: email@example.com
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.
What about having a function: int lua_SendToOutput(FILE* stream, const
char *pBuffer, ...);
Then, all calls to printf in use this (ie. lua_SendToOutput(stdout,...) and
lua_SendToOutput(stderr, ...)). So, if you wanted to trap output you only
have to edit one function in lua to embed it properly in your code. And you
can grab the output of files if you want to check what they are writing....
I think this will work....?
printf("%d %d %d", 1,2,3);
lua_SendToOutput(stdout, "%d %d %d", 1,2,3);
fprintf(stderr, "%d %d %d", 1,2,3);
lua_SendToOutput(stderr, "%d %d %d", 1,2,3);
fprintf(myFile, "%d %d %d", 1,2,3);
lua_SendToOutput(myFile, "%d %d %d", 1,2,3);
void lua_SendToOutput(FILE* stream, char *fmt, ...)
vsprintf(buff, fmt, argp);
// This is Lua's default call which I can now edit to redirect the
// wherever I like.
e.g. I could alter fprintf(stream, buff); to
(This sends everything, including files, to my console window).
Paul Bleisch <firstname.lastname@example.org> on 23/06/98 03:53:15 PM
Please respond to email@example.com
To: Multiple recipients of list <firstname.lastname@example.org>
cc: (bcc: Nick Trout/UK/PSYGNOSIS)
Subject: Re: Windows console
I have one that is just about ready. It is very basic. You can
files on it and it will do_file() them. (Optionally resetting the
between files.) There is a single input field for testing things.
As soon as I hook up a Lua print() facility to output to the console it
will be usable. By default it builds against tklua (no GL) and the
It is called WinLua or salt (stupid-ass-lua-tool).
Let me know if this will work for ya.
On Tue, Jun 23, 1998 at 05:53:51AM -0300, Nick.Trout@psygnosis.co.uk wrote:
> Has anyone written a nice Lua Windows console (as opposed to having to
> a DOS prompt) which they would be willing to post on here or point me to
> i.e. like the WinPython thing....