lua-users home
lua-l archive

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


I saw a problem like this, which turned out to be because I had an EOF
character at the end of my file.
[I could load the file using lua_dofile, but not lua_dobuffer.]

I fixed it by modifying my code to add a check for a terminating EOF,
and if there is one I simply pass a smaller len value to lua_dobuffer
to truncate the EOF.


-----Original Message-----
From: Matthias Gall []
Sent: 25 February 2001 20:39
To: Multiple recipients of list
Subject: Re: calling script with dobuffer doesnt work

> The problem is the last line.  The "write" function isn't built into the
> core lua language, it's actually part of the add-on I/O library.  You must
> initialize the standard libraries in your host "C" program before they can
> be used (lua.exe and luac.exe do this for you).

i already did that. the interesting thing is, that only lua_dobuffer does
not work, lua_dofile does!

thank you anyway,