- testé la possibilité de mettre une fonction dans une variable et une fonction d'une fonction. Super pratique !
This commit is contained in:
21
Tests/test_table_func.lua
Normal file
21
Tests/test_table_func.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
-- Tests de fonctions 'redirigées' dans une variable
|
||||
-- faut voir encore ceci:
|
||||
-- https://stackoverflow.com/questions/1791234/lua-call-function-from-a-string-with-function-name
|
||||
|
||||
print("\n test_table_func.lua zf180830.1224 \n")
|
||||
|
||||
|
||||
function toto()
|
||||
print("toto")
|
||||
end
|
||||
|
||||
function tutu(f)
|
||||
f()
|
||||
end
|
||||
|
||||
print("fonction dans une fonction")
|
||||
tutu(toto)
|
||||
|
||||
print("fonction dans une variable")
|
||||
titi=toto
|
||||
titi()
|
||||
Reference in New Issue
Block a user