lua-users home
lua-l archive

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

On Aug 7, 2005, at 12:24:38, Shmuel Zeigerman wrote:
Uli Kusterer wrote:
int        UKAdventureRoomToString( lua_State *pLuaState )
    UKRoom*        self = UKAdventureRoomGetThis( pLuaState );
    lua_pushfstring( pLuaState, "Room(%lx)", (unsigned long)self );
    return 1;

If you work with Lua 5.1w6, then try:
     lua_pushfstring( pLuaState, "Room(%p)", self );

Otherwise, use sprintf and lua_pushstring.

(lua_pushfstring doesn't support %x).


thanks. I'm still using 5.0.2 right now, but since this was mainly for testing right now, I just changed it to lua_pushstring ( pLuaState, "Room" ); and this call magically started working.

-- M. Uli Kusterer