[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: CallBacks and Proto
- From: jdarling@...
- Date: Thu, 26 Oct 2006 09:10:04 -0700
I know I've seen this answer here some place, but I can't find it in my
searchs (proto, lua, callback, function, cfunction). I have a script
that defines a callback to be called by source method being called by
the script. Ok that makes no sense, so lets try some sample source:
:SCRIPT:
v = {[1]='Hello', [2]='World', [3], '!'}
function foo(i)
print(v[i]..' ')
end
TestCallback(table.getn(v), foo)
:ENDSCRIPT:
Now TestCallback is defined in my source code and recieves the getn(v)
fine (3 in this case) it then attempts to store the method pointer for
foo (I thought it would be cfunction type, but its proto) of course
this doesn't work for calling later on. So how can I store the proto
and use it later? I'm guessing that proto means prototype or method
prototype, but can't find any info on using it or what the structure
looks like.
- Jeremy
"Help I suffer from the oxymoron Corporate Security."