[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: _ALERT gone in 5.0?
- From: <phil@...>
- Date: Tue, 24 Dec 2002 22:54:28 -0000
phil@flamewars.org said:
> I have converted my code to use lua_pcall, and to print the error messages.
> Works great. Thanks. But I still can't figure out loadfile. I'm loading a
> script like this:
>
> if (luaL_loadfile(L, filename) != 0)
> {
> // Error occurred
> cout << "Error occurred: " << lua_tostring(client_state, -1);
> }
>
> where filename is of course a string containing the file name. But this seems
> to do nothing at all. The call to luaL_loadfile does not fail, it just doesn't
> load the file. Subsequent calls to functions the script is supposed to define
> fail with the message 'attempt to call a nil value'. What am I doing wrong?
>
> Thanks, Philip Bock
>
Sorry, that should have been like this:
if (luaL_loadfile(L, filename) != 0)
{
// Error occurred
cout << "Error occurred: " << lua_tostring(L, -1);
}
--