splits
#1

Код:
forward splits(const strsrc[], strdest[][], delimiter);
LoadMOTDs()
{
	new arrCoords[4][128];
	new strFromFile2[512];
	new File: file = fopen("motd.ini", io_read);
	if (file)
	{
		fread(file, strFromFile2);
		splits(strFromFile2, arrCoords, '|');
Says splits isnt implemented ? giving me that error whys that I have it forwarded
Reply
#2

You need to create your splits function code, you can't just use the 'forward' function and expect the function to exist.

Judging by a ****** search, your code should be as follows:
pawn Код:
forward splits(const strsrc[], strdest[][], delimiter);
public splits(const strsrc[],strdest[][],delimiter)
{
    new aNum, len, i, li;
    while(i <= strlen(strsrc))
    {
        if(strsrc[i] == delimiter || i == strlen(strsrc))
        {
            len = strmid(strdest[aNum],strsrc,li,i,128);
            strdest[aNum][len] = false;
            li = i+1;
            aNum++;
        }
        i++;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)