HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

struct member array size issue

06-04-2009, 10:32 PM#1
emjlr3
why won't

Collapse JASS:
struct retarded
  real array dam[bj_MAX_PLAYERS]
endstruct

compile?

when

Collapse JASS:
struct retarded
  real array dam[12]
endstruct

does.....
06-04-2009, 11:14 PM#2
Bobo_The_Kodo
Replace bj_MAX_PLAYERS with 12
06-05-2009, 12:27 AM#3
Anitarf
Also, give a name to your struct.
06-05-2009, 12:55 PM#4
emjlr3
i typed that in the post message field

the syntax was correct in my WE

I am more concerned with why bj_MAX_PLAYERS cannot be the size of a struct member array

obviously 12 works just as well (or better in this case), but thats hardly the issue here...perhaps I should have posted this in the JassHelper thread
06-05-2009, 01:10 PM#5
akolyt0r
Quote:
Originally Posted by emjlr3
i typed that in the post message field

the syntax was correct in my WE

I am more concerned with why bj_MAX_PLAYERS cannot be the size of a struct member array

obviously 12 works just as well (or better in this case), but thats hardly the issue here...perhaps I should have posted this in the JassHelper thread

Well wait until Vex will pares blizzard.j one day and that issue will be gone maybe ...
It really doesnt matter anyway...
dumb workaround:

Collapse JASS:
globals
    constant integer FOO = bj_constant
endglobals

struct bar
    integer array foobar[FOO]
endstruct
06-05-2009, 03:11 PM#6
Vexorian
It matters.

As for next version I have to parse common.j (hooks) I will also parse blizzard.j at least bj constants will be usable in this way.
06-05-2009, 04:01 PM#7
emjlr3
sounds good