02.04.2011, 14:35
pawn Код:
#define findNextPositive(%0,%1,%2) findNext(%0,%1,1,%2)
#define findNextNegative(%0,%1,%2) findNext(%0,%1,0,%2)
static stock findNext(const array[], index, type, len = sizeof(array))
{
new _next = -1;
for(new x = index + 1; x < len; ++x)
{
if((type) ? (array[x]) : (!array[x]))
{
_next = x;
break;
}
}
return _next;
}