• 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] function call

Status
Not open for further replies.

ABM

ABM

Level 7
Joined
Jul 13, 2005
Messages
279
when i am inside library A
and i want to call a private function
should i call FunctionName()
or
should i call LibraryA_FunctionName()
?
 

ABM

ABM

Level 7
Joined
Jul 13, 2005
Messages
279
i though that private function were impossible to be called outside of the scope or library they were in? because they were private to that scope/library...
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
Short answer: It is impossible.

However, jass doesnt support private/public, so vJass simulates it by adding random stuff to the function name. So its not really impossible, you just have to be lucky and find the right name. But even the attempt to abuse this is a mortal sin.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
Private functions cannot be called from outside a library. The compiler will change the number of '_' characters to enforce that. You should still be able to run private functions from outside a library using the execute function native since JassHelper cannot resolve runtime strings at compile time and thus see that the function is being executed.
 
Private functions cannot be called from outside a library. The compiler will change the number of '_' characters to enforce that. You should still be able to run private functions from outside a library using the execute function native since JassHelper cannot resolve runtime strings at compile time and thus see that the function is being executed.

Untrue, the number of '_' is purely random. I tested by saving a map multiple times while calling a private function. Sometimes it worked, sometimes it didn't. The number of '_' appeared to be entirely random.
 
Status
Not open for further replies.
Top