05.07.2011, 05:20
pawn Код:
new Rows = 0, Currentrow = -1/*It is -1 for the Currentrow + 1 below*/, R = -1, Float:PositionY;
for(new i = 0; i != 14; i++)
{
R = strfind(text, "~n~", true, Currentrow + 1);//
if(R != -1)
{
Rows ++;
Currentrow = R;
printf("Currentrow: %d", Currentrow);
}
}
printf("Rows: %d", Rows);
So if the first time it find it at cell 0, the next strfind will start to search at 0, which will match the ~n~ at cell 0 again.
If you have Currentrow + 1, it will start at cell 1 to search again, so that it will not match the previous one.