lua-users home
lua-l archive

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


Michael Newberry wrote:

I think I see what is happening (is this correct?): I have assigned sOldTitle as the value of SetTitle(), so the fact that I did not update sOldTitle by the second call to SetTitle() means that sOldTitle was automatically updated by lua_pushstring() inside SetTitle(). Is this correct? If so, then I could solve the problem by using a dummy value to catch the unused return from the second call to SetTitle(). But I wonder if there is a better way; otherwise that is a "gotcha" waiting to happen again.

lua_pushstring just pushes a string on the stack, it's the assigment that binds that string to a particular variable (sOldTitle in this case). The result in the second call was probably discarded. It'd help a lot if we could see the code of SetTitle().