TStreamWriter issue. Real reason of problem
GoogleCodeExporter opened this issue · 0 comments
GoogleCodeExporter commented
Hello!
The reason why TStreamWriter write only zero-char in file:
when you using Delphi, calling function:
procedure TStreamWriter.WriteLine(const Value: string);
when you using JavaScript, calling function:
procedure TStreamWriter.WriteLine(Value: Char);
Looks like function that responsible to found proper overloaded method doesn't
work correctly.
With best regards,
Original issue reported on code.google.com by andre...@diatomenterprises.com on 6 Dec 2013 at 12:18
GoogleCodeExporter commented
How I solving it for now :)
I create my own class:
TMyStreamWriter = class (TStreamWriter)
public
procedure WriteStringLine (const Value: string);
end;
With only one method, specially for string variable.
procedure TMyStreamWriter.WriteStringLine (const Value: string);
begin
WriteLine (Value);
end;
Sample on JavaScript:
var z = TMyStreamWriter ("C:\\Temp\\test9.txt", True);
z.WriteStringLine ("abcdef100500!");
z.Free ();
Original comment by andre...@diatomenterprises.com on 6 Dec 2013 at 12:40
GoogleCodeExporter commented
For strings of length 1 writeLine(char) will be called for other cases
writeline(string)
Original comment by n.ame...@gmail.com on 6 Dec 2013 at 2:39
- Changed state: Fixed