lua-users home
lua-l archive

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


Alex Queiroz wrote:

Hallo,

On 8/14/06, Sergey Beloshitsky <sergey@rostok-games.com.ua> wrote:


I have procedure (in C) which saves my tables, but among numbers and
strings they also have pointers to functions, so i would like to save
function names instead of pointers and then, when loading, swap names
back to pointers(it is quite easy).

can someone help me with this task?


Why don't you use the names of the functions as the table keys?

but how?
for example i have table A, and function f

A = {}
function f()
print("lalala")
end

then i do next
A.callback = f;

so anywhere in my scripts i can do A.callback();
and then i want to save my table A. How can i substitute pointer by function name?


--
Шукай в телефонi мiй слiд...