SA-MP Forums Archive
strfind vs ~n~? bug? keeps returning 13 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: strfind vs ~n~? bug? keeps returning 13 (/showthread.php?tid=263086)



strfind vs ~n~? bug? keeps returning 14 - Donya - 20.06.2011

pawn Код:
new Rows = 0, Currentrow = 0, R = -1;
    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);;
I'm trying to find how many "~n~"'s are in a text. now the text i tested this is

pawn Код:
"~n~Hello~n~"
notice: 2 ~n~'s

i also tested it with 9 ~n~'s, and it keeps returning 13