06.07.2012, 16:56
Hello all, sorry about my bad english
i tried to build stock (a_Set) that like dini_Set
but i have few errors
this is the code
and this is the stock
Help me please !!
i tried to build stock (a_Set) that like dini_Set
but i have few errors
Код:
C:\Documents and Settings\1\щемзп дтбегд\0.3e шщойъ\pawno\include\a_file.inc(61) : error 079: inconsistent return types (array & non-array) C:\Documents and Settings\1\щемзп дтбегд\0.3e шщойъ\pawno\include\a_file.inc(80) : error 079: inconsistent return types (array & non-array) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
Код:
a_Set("Test.ini","ss","Test");
Код:
stock a_Set(file[], key[], value[]) { if(!fexist(file)) return false; new File:fpt = fopen(file, io_read),String[200]; format(String, sizeof(String), "%s.part",file); new result[100],line[100],k; while (fread(fpt, line)) { if(!strcmp(key, line, false, strlen(key))) { new e = strfind(line, "="); strcat(result, line[e+1]); k = 1; return result; } } if(!k) { while(fread(fpt, line)) fwrite(fpt, line); format(String, sizeof(String), "%s=%s",key,value); fwrite(fpt, String); } return true; }