Next: 5.2 Converting Values between Up: 5 The Application Program Previous: 5 The Application Program

5.1 Executing Lua Code

A host program can execute Lua programs written in a file or in a string, using the following functions:

int            lua_dofile               (char *filename);
int            lua_dostring             (char *string);
Both functions return an error code: 0, in case of success; non zero, in case of errors. The function lua_dofile, if called with argument NULL (0), executes the ``file'' stdin.


Next: 5.2 Converting Values between Up: 5 The Application Program Previous: 5 The Application Program