Running caption of the label

Posted in Components

Use Label and Timer components. It is necessary to repeat the last part of the string for getting "running" effect.

procedure TForm1.Timer1Timer(Sender: TObject);
const
  Str: string = 'It is necessary to repeat the last part' + 
    'of this string. It is necessary to re';
  i: Integer = 1;
  Count: Integer = 20;
begin
  Label1.Caption:=Copy(Str, i, Count);
  Inc(i);
  if i>Length(Str)-Count then i:=1;
end;