I'm gettin an error at line 18: unit1.pas(870,12) Error: Operator is not overloaded: - "AnsiString". I don't understand?
Var 2S : String = ' Notes: aaaa bb ccccccc dddddddddd eeeeeee fffffff ggggg hh iiiiiii jjjjj kkkkkkkkkk llllllllll m n oooooooo pppppp qqqqqq rrrrrr sssssssss ttttt uuuuuuuuuuuuuu vvvvvv wwwwwwwww x yy zzzzzzz.
Sl is a TstringList I'm passing in and stores the reply.
It work somewhat but not really good. And with the error not at all
Call: parseforlength(sToParse, SL );
procedure TForm1.ParseForLength(const sToParse : String; SL: TStringList);
var S : String;
sInsert : String[14] = ' ';
p1, p2,s2P, Lgth : SizeInt;
sSize : Integer = 107;
s2Parse : String;
begin
s2Parse := sToParse;
s2P := Length(s2Parse);
if s2P <= sSize then begin SL.ADD(s2Parse); exit; end;
p1 := 5;
repeat
p1 := PosEx(' ', sToParse, p1);
if ( p1 > 0 ) then begin
p2 := PosEx(' ', s2Parse, p1 + 1 );
if (p2 > sSize) then begin
Insert( '|',s2Parse, P1 ); -
S := Copy2SymbDel(s2Parse, '|');
SL.Add(S);
s2Parse := Concat( sInsert, s2Parse);
if ( Lgth = 0 ) or ( s2P < sSize ) or ( p1 = 0) then begin
P1 := 0; P2 := 0;
s2Parse := Concat( sInsert, s2Parse);
SL.Add(s2Parse);
exit;
end else begin
p1 := 8; P2 := 1;
end;
end;
P1 := p2 + 1;
end;
until (p1 = 0) or (p2 = 0);
end;
Results should be:
' Notes: aaaa bb ccccccc dddddddddd eeeeeee fffffff ggggg hh iiiiiii jjjjj kkkkkkkk
llllllllll m n oooooooo pppppp qqqqqq rrrrrr sssssssss ttttt uuuuuuuuuuuuu
vvvvvv wwwwwwwww x yy zzzzzzz.
Thanks