[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()
?
 
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...
 
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.
 
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.
Back
Top