02.08.2012, 12:36
I'm making an include for something, and I need to address a multidimensional array within an enum. The following example will not work:
Are there any alternatives for this? i'd like to keep the enum as this simplifies my problem. The errors are as followed:
pawn Code:
// This, ofcourse, will not give any errors
#define ARRAY_SIZE 10
#define ENUM_SIZE 10
enum edata {
E_DATA[ARRAY_SIZE]
}
new Enum[ENUM_SIZE][edata];
// This will not work, assuming "idx" is a valid index (Line 45)
Enum[idx][E_DATA[idx]] = someValue;
// This also gives some errors
Enum[idx][E_DATA][idx] = someValue;
Code:
C:~PATH~\~INCLUDE~.inc(45) : error 028: invalid subscript (not an array or too many subscripts): "E_DATA" C:~PATH~\~INCLUDE~.inc(45) : warning 215: expression has no effect C:~PATH~\~INCLUDE~.inc(45) : error 001: expected token: ";", but found "]" C:~PATH~\~INCLUDE~.inc(45) : error 029: invalid expression, assumed zero C:~PATH~\~INCLUDE~.inc(45) : fatal error 107: too many error messages on one line