lua-users home
lua-l archive

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

Hmmm. I think I solved both problems. You were right
Ashwin. After building my own lua.dll and lualib.dll
instead of using the stock dlls from the Lua website,
the problem went away for both. So I think there is a
problem with the stock dll.

So I don't need to redefine _ALERT because it works
fine. And I no longer need to redefine print which
also works fine.

To the Lua maintainers, if you would like this new dll
or project file, I would be happy to supply it. I also
have a MacOSX library "Framework" (with installer) if
you're interested.


--- Ashwin Hirschi <> wrote:
> > > The solution I found is similar to the one you
> > > already described: just make
> > > sure you register your own print replacement
> (for
> > > debugging &c.) and[!] a
> > > function to handle _ALERT. The latter is the
> > > function that gets called
> > > whenever Lua (v4) outputs any errors. I found
> that
> > > redefining these 2
> > > functions prevented my Lua GUI host app from
> taking
> > > unexpected nose dives.
> >
> > I'm still using Lua 4 too. Can you tell me more
> about
> > _ALERT? I don't know about it, and I don't
> remember
> > seeing it in any of the Lua documentation I have.
> I guess the best thing to do if you want to know
> about _ALERT is to look at
> lbaselib.c and liolib.c. You can find them in Lua's
> src/lib directory (from
> Lua 4's source distribution). There are very few
> references, so it won't
> take long.
> Both modules provide error handlers
> (luaB__ERRORMESSAGE and errorfb, resp.)
> implementing Lua's _ERRORMESSAGE. These handlers use
> _ALERT to output error
> messages. The provided _ALERT implementation
> (luaB__ALERT) outputs to
> stderr.
> By redefining _ALERT you make sure the error
> messages end up where they need
> to. For instance, wiring _ALERT to a function that
> calls Windows' MessageBox
> function should give you some decent default
> behaviour.
> Ashwin.

Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.