How to forward reference?

How do you forward reference a function or variable? eg

local function A ()

if B (value) == …

end

local function B ()

end

I’m sure I read of a way to do this when first reading up on LUA but can’t find anything now.

[import]uid: 3093 topic_id: 18522 reply_id: 318522[/import]

[lua]local foo1
local foo2
function foo2()
foo1()
end

function foo1()
print(“forwarding”)
end

foo2()
[lua]something like this [import]uid: 16142 topic_id: 18522 reply_id: 71047[/import]

yes, forward declaring makes your life so much easier) [import]uid: 16142 topic_id: 18522 reply_id: 71058[/import]

thanks hope this will come up when searching for forward reference / forward referencing. As per example remember NOT to make functions local [import]uid: 3093 topic_id: 18522 reply_id: 71056[/import]