• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[vJASS] Constants can't be used to give array size?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,337
Hi,

I'm getting a "wrong [size]" error.

Here's the code:

JASS:
library myLib
globals
  constant integer I = 10
  constant integer J = 10
endglobals

struct myStruct
integer array ij[I * J] //this gives the error
endstruct
endlibrary

This is perplexing, because I read in the manual you can use constants in arrays. I don't see why the arithmetic functions can't be used to compute the array size either...
 
Status
Not open for further replies.
Top