strfind looping problem..
#1

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
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);
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
Reply


Messages In This Thread
strfind looping problem.. - by Donya - 05.07.2011, 05:14
Re: strfind looping problem.. - by leong124 - 05.07.2011, 05:20
Re: strfind looping problem.. - by Donya - 05.07.2011, 05:46

Forum Jump:


Users browsing this thread: 3 Guest(s)