Autor Beitrag
ardely
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 66



BeitragVerfasst: Di 24.07.07 20:45 
Hallo,
Mit einem Tedit und einem TUpDown kann man Zahlen inkrementieren und dekrementieren. Meine frage wäre gibt ein komponet der auch die die Buchstaben
inkrementieren z.B. von A bis Z

Sehr vielen Dank für Ihre unterstützung, Grüsst
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 24.07.07 20:47 
Jein. Du kannst c := Chr( Ord(c) +1); nehmen

_________________
Markus Kinzler.
ardely Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 66



BeitragVerfasst: Di 24.07.07 20:55 
Sehr vielen Dank für die schnelle Antwort, probiere sofort aus.
FAlter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 192

Win XP Home
Turbo Delphi 2006 (Win32), C# (VS 2008 Prof.), Java (Eclipse), PHP
BeitragVerfasst: Di 24.07.07 21:02 
Hi,

user profile iconmkinzler hat folgendes geschrieben:
Jein. Du kannst c := Chr( Ord(c) +1); nehmen


inc(c) geht auch und sieht besser aus ;)

Mfg
FAlter
ardely Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 66



BeitragVerfasst: Di 24.07.07 21:21 
Hallo,
Ich habe das ausprobiert und nach dem 'A' bekomme ich die Sonderzeichen...
also nicht den 'B'...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure TForm1.FormCreate(Sender: TObject);
begin
   edit2.Text := 'A'
end;

procedure TForm1.UpDown2Click(Sender: TObject; Button: TUDBtnType);
var
c : char;
begin
 c :=  Chr( Ord(c) +  UpDown2.Position );
 edit2.Text := c;

end;



zur 'FAlter' dein Rat mit inc(c) da komme ich nicht zurecht, ein Fehler type incompatible

meinst du sowas...
ausblenden Delphi-Quelltext
1:
 c :=  Chr( Inc(c) +  UpDown2.Position ); // type incompatible !!!					


Danke.
FAlter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 192

Win XP Home
Turbo Delphi 2006 (Win32), C# (VS 2008 Prof.), Java (Eclipse), PHP
BeitragVerfasst: Di 24.07.07 21:25 
Hi,

ich meinte es so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
inc(c);
//tut das gleiche wie
c := Char(Ord(C) + 1);

//oder in deinem Fall
c := 'A';
inc(c, UpDown2.Position);
Edit2.Text := c;


Mfg
FAlter
ardely Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 66



BeitragVerfasst: Di 24.07.07 22:09 
Vielen Dank für Ihre Hilfe, es funktioniert.. ich komme jetzt zurecht.
Schönen Abendende, Grüss