05.07.2011, 05:14
Ok, first off, i'm trying to detect how many "~n~"'s are in a string, the way i do it is. i first find the first ~n~, then save that position in the string with strfind, then start at that position for the next find, but yet. currentrow always return 0
edit below, i forgot to put the string i was trying to find in.
"~n~Hello~n~~n~"
so ya, if i start currentrow at 0, it can't start at currentrow + 1
pawn Код:
new Rows = 0, Currentrow = 0, R = -1, Float:PositionY;
for(new i = 0; i != 14; i++)
{
R = strfind(text, "~n~", true, Currentrow);
if(R != -1)
{
Rows ++;
Currentrow = R;
printf("Currentrow: %d", Currentrow);
}
}
printf("Rows: %d", Rows);
"~n~Hello~n~~n~"
so ya, if i start currentrow at 0, it can't start at currentrow + 1