06.12.2012, 13:47
Where i can find StripNewLine ?? my dutils give this error ( undefine symbol StripNewLine )
stock DINI_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 DINI_fcopytextfile(oldname[],newname[]) {
new File:ohnd,File:nhnd;
if (!fexist(oldname)) return false;
ohnd=fopen(oldname,io_read);
if (!ohnd) return false;
nhnd=fopen(newname,io_write);
if (!nhnd) {
fclose(ohnd);
return false;
}
new tmpres[DINI_MAX_STRING];
while (fread(ohnd,tmpres)) {
DINI_StripNewLine(tmpres);
format(tmpres,sizeof(tmpres),"%s\r\n",tmpres);
fwrite(nhnd,tmpres);
}
fclose(ohnd);
fclose(nhnd);
return true;
}
PHP код:
OffTopic; Rofl @ Signature. |