lua-users home
lua-l archive

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


I'm pretty sure (though not 100%) that that's just for C
compatibility, since win32 is a C API after all. C didn't have
dedicated true/false keywords before, and I *think* that true == 1 and
false == 0 still.

The typical Lua convention is to return nil, <error> on error, and
whatever the result is on non-error. It's not a hard-and-fast rule,
but some functions depend on it (like assert()).

On Mon, Aug 16, 2010 at 12:13 PM, Peyman <peiman_3009@yahoo.com> wrote:
>
> this is quote from most of APIs in MSDN :
> "If the function succeeds, the return value is nonzero."
>
> so in most of api return value is zero or nonzero so this is easy to check it in a if statement for my interpreter.
>