|
Junior Member
|
11-25-2018
, 07:20
Re: About Link Up the .ini Files to Plugins
|
#11
|
Quote:
Originally Posted by Ghosted
Code:
ReadFile(PathToFile[])
{
new File = fopen(PathToFile, "rt");
new Buffer[128], A[128], B[128];
while (!feof(File))
{
fgets(File, Buffer, charsmax(Buffer));
if (!Buffer[0] || Buffer[0] == '#')
continue;
remove_quotes(Buffer);
strtok(Buffer, A, charsmax(A), B, charsmax(B), '=');
trim(A);
trim(B);
//A=Key
//B=Value
}
fclose(File);
}
/not tested/
/i have not implemented sections, i think that is too much for simple ini files/
|
Hmm.. why did you set the parameters of "Buffer", "A", "B" as 128 and equalized "Buffer[0]" with "#"?
|
|
|
|