functions as variable values
Issue #26
invalid
I was thinking about creating some tables with functions as their data values for my script (for e.g. random menus). It could eventually look a bit like this:
// Value assignment
$var = function(arg1, arg2)
// Do something in here
end;
// Function call
$var();
Would be awesome if something like this could be implemented.
Comments (4)
-
-
reporter Hm, can you? If so, would you please be so nice to tell me? :3
-
For example like this:
function testFunc($var1, $var2) say $var1 $var2; end label Start $tableTest = {}; $tableTest[0] = $testFunc; $tableTest[0]("Creeper", "Hello!"); end
-
- changed status to invalid
- Log in to comment
But you can aready store functions in tables/variables. I have implemented random menus in my script.