![]() |
AW: Lauftext von rechts nach links
Danke Baumina jetzt klappt es
Delphi-Quellcode:
Ist bloss die frage warum hat es nicht mit textout geklappt?????
begin
a:='Anrede'; inc(i); if i > length(a)then begin timer1.Enabled:=false; exit; end; Label1.caption:= label1.Caption+ a[i]; |
AW: Lauftext von rechts nach links
Warum startet er den Timer nicht mehr wenn ich ihn erneut aktiviere
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin label1.caption:=''; timer1.Enabled:=true; end;
Delphi-Quellcode:
procedure TForm1.Timer1Timer(Sender: TObject);
begin a:='Anrede'; inc(i); if i > length(a)then begin timer1.Enabled:=false; exit; end; Label1.caption:= label1.Caption+ a[i]; end; |
AW: Lauftext von rechts nach links
Der Timer staret bestimmt, nur hast du vergessen i zurückzusetzen.
|
AW: Lauftext von rechts nach links
Oh Ja alles klar Danke
Delphi-Quellcode:
Kann ich auch was anderes für i:=-1; schreiben sowas wie reset(i) oder so???
procedure TForm1.Button1Click(Sender: TObject);
begin i:=-1;// Variable i zurücksetzten label1.Caption:=''; timer1.Enabled:=true; end; |
AW: Lauftext von rechts nach links
Zitat:
|
AW: Lauftext von rechts nach links
Wem es Spaß macht:
Delphi-Quellcode:
procedure Reset(out Zahl: integer);
begin Zahl := -1; end; |
AW: Lauftext von rechts nach links
Danke :)
Habe mal versucht ein Procedure draus zu basteln Funktioniert nur nicht hmmmm Wo ist der fehler???
Delphi-Quellcode:
procedure Laufschrift(Text:string;timer:ttimer;Ausgabe:string);
begin a:=Text; inc(i); if i > length(a)then begin timer.Enabled:=false; exit; end; Ausgabe:= Ausgabe + a[i]; end; procedure TForm1.Button2Click(Sender: TObject); begin i:=-1; Timer2.Enabled:=true; end; procedure TForm1.Timer2Timer(Sender: TObject); begin Laufschrift('Hallo',timer2,label2.caption); end; |
AW: Lauftext von rechts nach links
Die Variable "Ausgabe" kennt die procedure Laufschrift nur lokal, alle Änderungen an der Variable werden nicht zurückgegeben. Zurückgegeben würde sie nur wenn du sie als var definierst (
Delphi-Quellcode:
) Allerdings kann man Label.Caption nicht als var-Parameter mitgeben.
procedure TForm63.Laufschrift(Text:string;timer:ttimer;var Ausgabe:string);
Diese ganze Konstruktion ist etwas seltsam. |
AW: Lauftext von rechts nach links
Ungetestet:
Delphi-Quellcode:
procedure Laufschrift(Text:string;timer:ttimer;var Ausgabe:string);
begin a:=Text; inc(i); if i > length(a)then begin timer.Enabled:=false; exit; end; Ausgabe:= Ausgabe + a[i]; end; procedure TForm1.Button2Click(Sender: TObject); begin i:=-1; Timer2.Enabled:=true; end; procedure TForm1.Timer2Timer(Sender: TObject); var s: string; begin s := label2.caption; Laufschrift('Hallo',timer2,s); label2.caption := s; end; |
AW: Lauftext von rechts nach links
Danke habe es jetzt so gemacht
Delphi-Quellcode:
procedure TForm1.Laufschrift(Text:string;timer:ttimer;la:Tlabel);
begin a:=Text; inc(i); if i > length(a)then begin timer.Enabled:=false; exit; end; la.caption:= la.caption + a[i]; end; procedure TForm1.Button2Click(Sender: TObject); begin i:=-1; Label2.Caption:=''; Timer2.Enabled:=true; end; procedure TForm1.Timer2Timer(Sender: TObject); begin Laufschrift('Hallo',timer2,label2); end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:31 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz