mam taki kod:
var
i: smallint;
s: string;
text: string;
begin
text := 'Name: Peter Quistgard; Seria';
if not Canvas.TextWidth(text) <= Main.lastmsg.Width then
begin
for i := length(text) downto 0 do
begin
s := Copy(text, 0, i);
if not (Canvas.TextWidth(s) <= 121) then
Continue
else
text := s + '...';
end;
end;
no i jest problem bo gdy chce to zrobić:
s := Copy(text, 0, i);
to mi za 'i' podstawia 0. a powinno być 'i' długość zmiennej 'text' (oczywiście za każdym razem zmiejszana). co mam robic?
wypróbujcie ten kod.