Iv managed to round it down to 3 functions that the problem is in, think i know what it could be now


Yeah my stream class does read and write a string,
its not that cause i use it in all my class types,

when i write a string, say 'SAMPLE' then it writes each character and then adds #0 to then end, when i read it it just reads a character at a time until it reaches the #0 character..

source (TxnStream is based on TFileStream):
[pascal]
procedure TxnStream.WriteChar(const Value: Char);
begin
Write(Value, SizeOf(Char));
end;

procedure TxnStream.ReadChar(var Value: Char);
begin
Read(Value, SizeOf(Char));
end;

procedure TxnStream.WriteString(const Value: String);
var
i: Integer;
begin
For i := 1 To Length(Value) Do WriteChar(Value[i]);
WriteChar(#0);
end;

procedure TxnStream.ReadString(var Value: String);
var
c: Char;
begin
Value := '';
Repeat
ReadChar(c);
If c <> #0 Then Value := Concat(Value, c);
Until c = #0;
end;
[/pascal]