If you have used fastfileappend function in the past - would you please confirm the equivalent code for this?
fileappend("c:\temp",numtostr(date,0)+newline);
fastfileappend("c:\temp",numtostr(date,0)+newline); -- Though there are no errors with this line(when replaced fileappend with fastfileappend) - it doesn't produce the same results as fileappend.
thanks
fastfileappend - newline character [SOLVED]
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: fastfileappend - newline character
what results do you have?If you have used fastfileappend function in the past - would you please confirm the equivalent code for this?
fileappend("c:\temp",numtostr(date,0)+newline);
fastfileappend("c:\temp",numtostr(date,0)+newline); -- Though there are no errors with this line(when replaced fileappend with fastfileappend) - it doesn't produce the same results as fileappend.
thanks
what results you are expecting?
Re: fastfileappend - newline character
with fileappend -I get the new line character properly appended ( each new entry goes to the next line).
with fastfileappend + newline -> no text is being appended.
The following code with fileappend - works fine as expected.
The following code with fastfileappend - doesn't work as expected (only see header and nothing else).
output:
Code with fileappend:
C:\>del test.txt
C:\>type test.txt
DATE
1120528
1120529
Code with fastfileappend:
C:\>del test.txt
C:\>type test.txt
DATE
C:\>
When the second code with fastfileappend is executed again ( by turning off / turning on the indicator - this is the output - which matches the first one ) There is one time parse information is missing with fastfileappend.
C:\>type test.txt
DATE
1120528
1120529
with fastfileappend + newline -> no text is being appended.
The following code with fileappend - works fine as expected.
Code: Select all
vars: filename("C:\test.txt");
Once begin
if ADE.FileExists(filename)=false then begin
FileAppend(filename,"DATE"+newline);
end;
end;
if date<>date[1] then begin
FileAppend(filename,numtostr(DATE,0)+newline);
end;
The following code with fastfileappend - doesn't work as expected (only see header and nothing else).
Code: Select all
vars: filename("C:\test.txt");
Once begin
if ADE.FileExists(filename)=false then begin
FileAppend(filename,"DATE"+newline);
end;
end;
if date<>date[1] then begin
FastFileAppend(filename,numtostr(DATE,0)+newline);
end;
Code with fileappend:
C:\>del test.txt
C:\>type test.txt
DATE
1120528
1120529
Code with fastfileappend:
C:\>del test.txt
C:\>type test.txt
DATE
C:\>
When the second code with fastfileappend is executed again ( by turning off / turning on the indicator - this is the output - which matches the first one ) There is one time parse information is missing with fastfileappend.
C:\>type test.txt
DATE
1120528
1120529
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: fastfileappend - newline character
Yes. I am also checking few more options for fastfileappend.dll - like flush mode etc to see if I can get the results same as fileappend.do you have the FastFileAppend.dll in your computer?
Thanks
Re: fastfileappend - newline character [SOLVED]
The following code takes care of the issue:
Code: Select all
vars: filename("C:\test.txt");
Once begin
condition1=FastFileFlushMode(3);
if ADE.FileExists(filename)=false then begin
condition1=FastFileAppend(filename,"DATE"+newline);
condition1=FastFileFlush(filename);
end;
end;
if date<>date[1] then begin
condition1=FastFileAppend(filename,numtostr(DATE,0)+newline);
condition1=FastFileFlush(filename);
end;