Struct Arrays Problem

_whelp

New Member
Reaction score
54
How come when I use a variable for the size of an array in a struct, it throws a compile error?

Etc.
JASS:

struct test
    private static integer arraysize = 12
    private integer array anarray[.arraysize]
endstruct
 

Romek

Super Moderator
Reaction score
963
Only raw integer values and constant integers can be used when setting the size of an array.
Thus, [ljass]arraysize[/ljass] would need to be a constant.
JASS:
private static constant integer arraysize = 12
 

Tru_Power22

You can change this now in User CP.
Reaction score
144
Only raw integer values and constant integers can be used when setting the size of an array.
Thus, [ljass]arraysize[/ljass] would need to be a constant.
JASS:
private static constant integer arraysize = 12

See that would be very cool, if with the next version of jass helper. Vexorial lets you use [ljass]constant[/ljass] vars to create arrays (complie time, not runtime sadly).

Not like it matters though as arrays have a constant size of 8191.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top