• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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