Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8078 in orxonox.OLD


Ignore:
Timestamp:
Jun 1, 2006, 4:03:08 PM (18 years ago)
Author:
snellen
Message:

added example how to return values to lua

Location:
branches/script_engine/src/lib/script_engine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/script_engine/src/lib/script_engine/account.cc

    r8076 r8078  
    4242        ~Object() { printf("deleted Object (%p)\n", this); }
    4343
    44         int getCallCount(lua_State* L){return getCallCount();}
     44        //lua Interface
     45        int getCallCount(lua_State* L){int calls = getCallCount(); lua_pushnumber(L,(lua_Number)calls);return 1;}
     46
    4547
    4648        int printName(lua_State* L)
  • branches/script_engine/src/lib/script_engine/lunartest2.lua

    r8076 r8078  
    1919  io.write(" as parameter\n")
    2020  Obj:printName()
    21   io.write("callCount is now",Obj:getCallCount())
     21  callCount = Obj:getCallCount()
     22  io.write("callCount is now ",callCount)
     23  io.write("\n")
     24
    2225  print('a =', a)
    2326  print('b =', b)
Note: See TracChangeset for help on using the changeset viewer.