symbol already defined: "StripNewLine"
#1

Code:
stock StripNewLine(string[])
{

  new len = strlen(string);
  if (string[0]==0) return ;
  if ((string[len - 1] == '\n') || (string[len - 1] == '\r'))
    {
      string[len - 1] = 0;
      if (string[0]==0) return ;
      if ((string[len - 2] == '\n') || (string[len - 2] == '\r')) string[len - 2] = 0;
    }
}

stock StripColorEmbedding(string[])
{
 	new i, tmp[7];
  	while (i < strlen(string) - 7)
	{
	    if (string[i] == '{' && string[i + 7] == '}')
		{
		    strmid(tmp, string, i + 1, i + 7);
			if (ishex(tmp))
			{
				strdel(string, i, i + 8);
				i = 0;
				continue;
			}
		}
		i++;
  	}
}

stock strtoupper(string[])
{
        new retStr[128], i, j;
        while ((j = string[i])) retStr[i++] = chrtoupper(j);
        retStr[i] = '\0';
        return retStr;
}

stock wordwrap(string[], width, seperator[] = "\n", dest[], size = sizeof(dest))
{
    if (dest[0])
    {
        dest[0] = '\0';
    }
    new
        length,
        multiple,
        processed,
        tmp[192];

    strmid(tmp, string, 0, width);
    length = strlen(string);

    if (width > length || !width)
    {
        memcpy(dest, string, _, size * 4, size);
        return 0;
    }
    for (new i = 1; i < length; i ++)
    {
        if (tmp[0] == ' ')
        {
            strdel(tmp, 0, 1);
        }
        multiple = !(i % width);
        if (multiple)
        {
            strcat(dest, tmp, size);
            strcat(dest, seperator, size);
            strmid(tmp, string, i, width + i);
            if (strlen(tmp) < width)
            {
                strmid(tmp, string, (width * processed) + width, length);
                if (tmp[0] == ' ')
                {
                    strdel(tmp, 0, 1);
                }
                strcat(dest, tmp, size);
                break;
            }
            processed++;
            continue;
        }
        else if (i == length - 1)
        {
            strmid(tmp, string, (width * processed), length);
            strcat(dest, tmp, size);
            break;
        }
    }
    return 1;
}
if i delete that StripNewLine i cant compile
Reply


Messages In This Thread
symbol already defined: "StripNewLine" - by PrinceKumar - 27.09.2016, 02:29
Re: symbol already defined: "StripNewLine" - by Tass007 - 27.09.2016, 02:39
Re: symbol already defined: "StripNewLine" - by PrinceKumar - 27.09.2016, 02:43
Re: symbol already defined: "StripNewLine" - by Tass007 - 27.09.2016, 03:02
Re: symbol already defined: "StripNewLine" - by PrinceKumar - 27.09.2016, 03:21
Re: symbol already defined: "StripNewLine" - by Tass007 - 27.09.2016, 04:42
Re: symbol already defined: "StripNewLine" - by PrinceKumar - 27.09.2016, 05:38
Re: symbol already defined: "StripNewLine" - by iLearner - 27.09.2016, 05:47
Re: symbol already defined: "StripNewLine" - by SickAttack - 27.09.2016, 05:52
Re: symbol already defined: "StripNewLine" - by PrinceKumar - 27.09.2016, 08:58

Forum Jump:


Users browsing this thread: 2 Guest(s)