01.10.2017, 14:27
(
Последний раз редактировалось m4karow; 01.10.2017 в 15:22.
)
Hey
Im using foreach 19 (0.4.3) and removing iterators from loop causes crash.
i followed the instuctions asthis topic says but the problem is still alive and sometimes this function causes this error too:
and this is my code:
output:
how could be the next id the array's max size?
output
thanks for your help
Im using foreach 19 (0.4.3) and removing iterators from loop causes crash.
i followed the instuctions asthis topic says but the problem is still alive and sometimes this function causes this error too:
Код HTML:
[2017/10/01 16:22:20] [debug] Run time error 4: "Array index out of bounds" [2017/10/01 16:22:20] [debug] Accessing element at index 1000 past array upper bound 999
Код HTML:
foreach(new serveritemid : ServerItems)
{
count[serveritemid]++;
if(count[serveritemid] == 3)
{
new Prev = Iter_Prev(ServerItems, serveritemid);
printf("remove %d || Prev: %d", serveritemid, Prev);
Iter_SafeRemove(ServerItems, serveritemid, Prev);
}
if(!Iter_Count(ServerItems))
{
printf("ServerItems empty");
}
printf("%d", serveritemid);
}
Код HTML:
[2017/10/01 17:19:30] 0 [2017/10/01 17:19:30] 1 [2017/10/01 17:19:30] 2 [2017/10/01 17:19:30] 3 [2017/10/01 17:19:30] 4 [2017/10/01 17:19:30] 5 [2017/10/01 17:19:30] 6 [2017/10/01 17:19:32] 0 [2017/10/01 17:19:32] 1 [2017/10/01 17:19:32] 2 [2017/10/01 17:19:32] 3 [2017/10/01 17:19:32] 4 [2017/10/01 17:19:32] 5 [2017/10/01 17:19:32] 6 [2017/10/01 17:19:34] remove 0 || Prev: 1000 [2017/10/01 17:19:34] 0 [2017/10/01 17:19:34] 0 [2017/10/01 17:19:34] 0 [2017/10/01 17:19:34] 0 [2017/10/01 17:19:34] 0
Код HTML:
foreach(new serveritemid : ServerItems)
{
count[serveritemid]++;
if(count[serveritemid] == 3)
{
new next = Iter_Next(ServerItems, serveritemid);
printf("remove %d || next: %d", serveritemid, next);
Iter_SafeRemove(ServerItems, serveritemid, next);
}
if(!Iter_Count(ServerItems))
{
printf("ServerItems empty");
}
printf("%d", serveritemid);
}
Код HTML:
[2017/10/01 17:17:15] 0 [2017/10/01 17:17:15] 1 [2017/10/01 17:17:15] 2 [2017/10/01 17:17:15] 3 [2017/10/01 17:17:15] 4 [2017/10/01 17:17:15] 5 [2017/10/01 17:17:15] 6 [2017/10/01 17:17:17] 0 [2017/10/01 17:17:17] 1 [2017/10/01 17:17:17] 2 [2017/10/01 17:17:17] 3 [2017/10/01 17:17:17] 4 [2017/10/01 17:17:17] 5 [2017/10/01 17:17:17] 6 [2017/10/01 17:17:19] remove 0 || next: 1 [2017/10/01 17:17:19] 0 [2017/10/01 17:17:19] 0 [2017/10/01 17:17:19] 0
thanks for your help


