HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

[vJass] get the name of a variable

07-18-2008, 06:00 PM#1
Troll-Brain
Collapse JASS:
library MyLibrary
   
   globals
      private integer Ipriv
      public integer Ipub
   endglobals

   function test takes nothing returns nothing
      call BJDebugMsg("MyLibrary___Ipriv")
      call BJDebugMsg("MyLibrary_Ipub")
   endfunction

endlibrary

something like that would be more sexy :

Collapse JASS:
   function test takes nothing returns nothing
      call BJDebugMsg(Ipriv.getName)
      call BJDebugMsg(Ipub.getName)
   endfunction

I know that example is useless. But not for the TriggerRegisterVariableEvent.

Btw thx blizzard to have forgotten this :

Quote:
Originally Posted by common.j
// EVENT_GAME_VARIABLE_LIMIT
//constant native string GetTriggeringVariableName takes nothing returns string
07-18-2008, 06:08 PM#2
Vexorian
So, in one hand this aids jasshelper. In the other hand, that VariableEvent thing is evil and has made my life miserable multiple times (I program the optimizer, ya know) So, I'd rather stop people from doing that...

Collapse JASS:

      call BJDebugMsg(SCOPE_PRIVATE+"Ipriv")
      call BJDebugMsg(SCOPE_PREFIX+"Ipub")
??
07-18-2008, 07:25 PM#3
Troll-Brain
Ok thx.

Why the variable event is evil ?
I dunno a better method to check when a player give gold to an other player.
07-18-2008, 08:06 PM#4
Vexorian
Take the evilness of ExecuteFunc and add the evilness from the "GUI local trick" and you got the evilness of the variable event as a result.

It is case insensitive and it makes strings able to hold identifiers...