30.10.2010, 19:08
Is it possible to assign a value [in my case reset to 0] to all items in an enumerated array
For instance:
enum data
{
data1,
data2,
data3,
data4,
data5
}
new array[data];
Instead of doing this:
array[data1] = 0;
array[data2] = 0;
array[data3] = 0;
array[data4] = 0;
array[data5] = 0;
Is there any way to assign all the items using a loop
for(new i;i<5;i++)
array[i]=0;
That gives me a tag mismatch error, any way around it?
Thanks for any replies :P
For instance:
enum data
{
data1,
data2,
data3,
data4,
data5
}
new array[data];
Instead of doing this:
array[data1] = 0;
array[data2] = 0;
array[data3] = 0;
array[data4] = 0;
array[data5] = 0;
Is there any way to assign all the items using a loop
for(new i;i<5;i++)
array[i]=0;
That gives me a tag mismatch error, any way around it?
Thanks for any replies :P