y_iterate
#1

I'm starting to learn how to use y_iterate and was wondering if when creating an iterator, is it possible to assign it a max value and have it loop through every value rather than having to manually add every value it can go through? I'm not sure how to word it, but it would look something like this if you don't understand.

pawn Код:
new Iterator:MyIter<MAX_PLAYERS>;
foreach(new i : MyIter)
{
    printf("%d",i);
}
The output would look something like this:
Код:
0
1
2
...
999
Reply
#2

What you need defeats the purpose of the foreach iterators, they are supposed to loop only thru valid values, if you want it to loop thru all, just use the normal loop and forget about iterators.
Reply
#3

Oh, I guess I misunderstood something when learning it. Thanks anyways :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)