lua-users home
lua-l archive

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


I've embedded lua 5.0 into my application.  I had a little bug in 
there like so...

  function my_function()

    if ( foo ) then

      -- i do stuff in here

    emd -- notice this is eMd!

  end


  When lua returned the error is simply got the message 

  "attempt to call a string value"

  ... without any source file and line number information that other 
errors normaly generate.  I traced it down to the 'addinfo' function 
in lua which gets a false from 'isLua(ci)'.

  I'm thinking this may be a problem with how i'm executing the lua 
code.  I currently call...

  luaL_loadbuffer( state, buffer, size, filename );
  lua_pcall( state, 0, LUA_MULTRET, 0 );

  Is this the correct way to execute my source file and get full 
error reporting?  If this is correct what else could be causing the 
lack of error info?  Thanks for the help.

  Tom