Search results
Results from the WOW.Com Content Network
Function names are often of the form p.myFunctionName, where p is the table from the return p at the bottom of your program. The reason for this is that you can only access functions that are entries in this table from the original #invoke statement. Functions for local use within the program can have any name.
Marshalling data between C and Lua functions is also done using the stack. To call a Lua function, arguments are pushed onto the stack, and then the lua_call is used to call the actual function. When writing a C function to be directly called from Lua, the arguments are read from the stack. Here is an example of calling a Lua function from C:
The functioncall is written as some.function.name(a,b,c) where some.function.name means something in the Extension:Scribunto/Lua reference manual and a,b,c are the arbitrary variable names you've chosen.
This module provides utilities for declaring classes in Lua code. It creates global variables, ... -- __class and __hash local function objtostr (obj) ...
It is intended for use by other Lua modules, and should not be-- called from #invoke directly. local libraryUtil = require ('libraryUtil') local checkType = libraryUtil. checkType local arguments = {}-- Generate four different tidyVal functions, so that we don't have to check the-- options every time we call it. local function tidyValDefault ...
This Lua module is used in system messages, ... if success then return title end end local function union (t1, t2)-- Returns the union of two arrays. local vals = {} ...
-----local libraryUtil = require ('libraryUtil') local p = {}-- Define often-used variables and functions. local floor = math.floor local infinity = math.huge local checkType = libraryUtil. checkType local checkTypeMulti = libraryUtil. checkTypeMulti----- isPositiveInteger---- This function returns true if the given value is a positive integer ...
Note: the above functions will fail if passed input that is not of type string or nil. This might be the case if you use the getArgs function in the main function of your module, and that function is called by another Lua module. In this case, you will need to check the type of your input.