• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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.
Top