• 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.

[JASS] Help on a critical function for my system!

Status
Not open for further replies.
Level 29
Joined
Jul 29, 2007
Messages
5,174
From what I read in the vJass manual just now, you can't even do that.
keyword simply gives you the option to declare... let's call them undeclared functions.

JASS:
// taken from the vJass manual

scope myScope

   private keyword B //we were able to declare B as private without having to actually
                     //include the statement of the function which would cause conflicts.

   private function A takes integer i returns nothing
       if(i!=0) then
           return B.evaluate(i-1)*2 //we can safely use B since it was already
                                    //declared as a private member of the scope
       endif
       return 0
   endfunction

   private function B takes integer i returns nothing
       if(i!=0) then
           return A(i-1)*3
       endif
       return 0
   endfunction

endscope

It would be the same as declaring functions in C++ like this, if you know what I mean:
Code:
int Addition(int,int);

void bla()
{
    Addition(1,1); // I can use Addition even though it was actually declared below me
}

int Addition(int a, int b)
{
    return a+b
}
 
Status
Not open for further replies.
Top