0 Members and 3 Guests are viewing this topic.
How about a Readini that you put in the section and key and it returns the value?I'm not sure if there already is one of these
Description: The function is designed to look as much as the built-in ReadINI as possible http://enesce.com/help/html/Functions/ReadINI.html
for i:=0 to strlen-1 do Begin
for i:=0 to strlen-2 do Begin
function TrimNewlines(EntireFile: TStringArray) : TStringArray;var rest : TStringArray; i, filelength : integer; resu: string;Begin filelength := ArrayHigh(EntireFile); SetArrayLength(rest, filelength+1); for i:=0 to filelength do begin if(EntireFile[i]='') then begin if(i<>0) then begin if(EntireFile[i-1]='') then begin rest[i]:='-'; continue; end; end; end; rest[i]:=EntireFile[i]; end; Result:=rest;end;
{ Remove all annoying whitespace } EntireFile := TrimNewlines(EntireFile); WriteFile(filename,''); { Make sure the file is empty } for i:=0 to ArrayHigh(EntireFile) do begin if(EntireFile[i]='-') then continue; WriteLnFile(filename, EntireFile[i]); end;
Awesome function. Thanks very much As for the newlines at the end of the file, I wrote a function to remove them. Here is it:-snip-No more annoying newlines at the end Cheers!NT
And as the lyrics go in the United State's national anthem: "America, f**k YEAH!".