initState()
The initState
method is used to initialize the UDA's state variables to
a known state.
Generally this would be values such as null or 0. A table containing the state variables
is passed into the initState
method and after modifying the values the
initState
method, returns the updated values. The initState
method
is not mandatory, when not present the state variables are automatically initialized to
null.
Example
function initState(state)
state[1] = 0
state[2] = 0
return state
end