[Solved] call a function inside a scope from outside

Status
Not open for further replies.
Scopes do not move code to the top like libraries do,
so it needs to be ensured that the scope is over the caller function.
Also to call a public scope function from outside it needs the scope
name as identifier before the function name. "ScopeName_FunctionName()"

Example:
JASS:
scope a
    public function foo takes nothing returns nothing
    endfunction
endscope

function bar takes nothing returns nothing
    call a_foo()
endfunction

If the scope should provide functions that should be able to be used from anywhere,
then it should not be a scope, but just a library. :)
 
Status
Not open for further replies.
Back
Top