23.02.2009, 16:20
there is a much better strtok - its double so fast how the from cutter :S
but ... look ****** post
pawn Код:
stock strtok(const string[], &index, const seperator[] = " ")
{
const size = 30;
new
idx = strfind(string, seperator, false, index),
result[size];
if(idx == -1)
{
if((idx = strlen(string)) > index)
strmid(result, string, index, idx, size),
index = idx;
}
else if(idx > (index + size - 1))
strmid(result, string, index, (idx = index + size - 1), size),
index = idx;
else strmid(result, string, index, idx, size),
index = idx + 1;
return result;
}
