very simple version of object system
#define max_objects 100000
new Iterator:fObjects<max_objects>;
main(){
new rows=50000;
if(!rows)return print("No objects in db!");
for(new i; i < rows; i++){
Iter_Add(fObjects,i);
}
//here is the bug i loaded 33346 but iter added 14100 rows...
printf("Rows: %d | Iter_Count(fObjects) : %d",rows,Iter_Count(fObjects));
return 1;
}
new Iterator:fTestIter<100000>;
CMD:foreach(pid){
new i;
for(i=0; i < 50000; i++){
Iter_Add(fTestIter,i);
}
fscm(pid,-1,"i: %d | iter_count: %d",i,Iter_Count(fTestIter));
return 1;
}
i: 50000 | iter_count: 28525
main()
{
new i,
Iterator:Test_Iter<100000>;
for(; i < 50000; i++)
{
Iter_Add(Test_Iter, i);
if(Iter_Contains(Test_Iter, i))
printf("Iterator %i has been added - Iter's size: %i", i, Iter_Count(Test_Iter));
else
printf("[%i] Nothing has been added - Iter's size: %i", i, Iter_Count(Test_Iter));
}
printf("i: %d | iter_count: %d", i, Iter_Count(Test_Iter));
}
[03:24:08] Iterator 14095 has been added - Iter's size: 14096 [03:24:08] Iterator 14096 has been added - Iter's size: 14097 [03:24:08] Iterator 14097 has been added - Iter's size: 14098 [03:24:08] Iterator 14098 has been added - Iter's size: 14099 [03:24:08] Iterator 14099 has been added - Iter's size: 14100 [03:24:08] Iterator 14100 has been added - Iter's size: 14100 [03:24:08] Iterator 14101 has been added - Iter's size: 14100 [03:24:08] Iterator 14102 has been added - Iter's size: 14100 [03:24:08] Iterator 14106 has been added - Iter's size: 14100
[03:24:09] Iterator 35570 has been added - Iter's size: 14100 [03:24:09] Iterator 35571 has been added - Iter's size: 14100 [03:24:09] Iterator 35572 has been added - Iter's size: 14100 [03:24:09] Iterator 35573 has been added - Iter's size: 14100 [03:24:09] Iterator 35574 has been added - Iter's size: 14100 [03:24:09] Iterator 35575 has been added - Iter's size: 14101
and that isnt awful coding practise cause i don't want to write some rows over and over again.
|
so it was just too hard to see your code over there and you just start talking some other things that doesn't even matter.
|