Autor Beitrag
Gwaineg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 55

WIN XP Prof
D7 Ent
BeitragVerfasst: Do 25.08.05 14:00 
also ich will in der Art AR0000001,AR0000002,AR0000003, ... durchnummerieren
und dafür verwenden ich einen integer der sich immer um eins erhöht

jetzt brauch ich nur noch eine Funktion die damit die Integer immer gleich lang sind wenn ich sie in strings umwandle, also mit vorangestellten Nullen
hab die schonmal gewusst nur leider wieder vergessen :?


Moderiert von user profile iconKlabautermann: Topic aus Sonstiges verschoben am Fr 26.08.2005 um 12:43
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Do 25.08.05 14:02 
Schau mal in der Online-Hilfe unter Format nach, das ist die Funktion, die du brauchst.

_________________
Bravery calls my name in the sound of the wind in the night...
Robert.Wachtel
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 895
Erhaltene Danke: 7

Windows 7 Ultimate x64
D5 Ent, D7 Arch, RAD Studio 2010 Pro, VS 2008
BeitragVerfasst: Do 25.08.05 14:03 
Format
TM
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 74

Win xp
D7 ET
BeitragVerfasst: Do 25.08.05 14:05 
Hallo,

wenn ich so was brauch, mach ichs so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var i:integer;
    nr:string;
...
nr:=inttostr(i) 
while length(nr)<7 do
 nr:='0'+nr;
nr:='AR'+nr;


Vielleicht gibts elegantere Lösungen, aber so gehts auch.

..

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt.

_________________
Dieser Beitrag enthält keine Schreibfehler.
Das sind versteckte Hinweise.
blaueled
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 133

Win XP
D5
BeitragVerfasst: Do 25.08.05 14:10 
hi,

Du brauchst:
ausblenden Delphi-Quelltext
1:
Format('AR%.7d', [1])					

Weil du eine Dezimal-Zahl hast, AR davor soll, und du 7 stellen haben willst.
in die Eckigen klammern muss dann nur noch deine Zahl.

Arne

//edit: Die Hilfe ist schlecht formatiert ...
//edit2:Waren wieder welche schneller ..

Moderiert von user profile iconChristian S.: Eine ganze Seite Hilfetext entfernt. Die Hilfe hat ja jeder auf dem Rechner ;-)
Gwaineg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 55

WIN XP Prof
D7 Ent
BeitragVerfasst: Fr 26.08.05 09:57 
ich meinte zwar eine andere methode aber format ist viel besser
hatte ganz vergessen dass es das gibt

thx
blaueled
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 133

Win XP
D5
BeitragVerfasst: So 28.08.05 18:43 
user profile iconblaueled hat folgendes geschrieben:
hi,

Du brauchst:
ausblenden Delphi-Quelltext
1:
Format('AR%.7d', [1])					

Weil du eine Dezimal-Zahl hast, AR davor soll, und du 7 stellen haben willst.
in die Eckigen klammern muss dann nur noch deine Zahl.

Arne

//edit: Die Hilfe ist schlecht formatiert ...
//edit2:Waren wieder welche schneller ..

Moderiert von user profile iconChristian S.: Eine ganze Seite Hilfetext entfernt. Die Hilfe hat ja jeder auf dem Rechner ;-)

ja, aber es gibt viele, die das nicht zu wissen scheinen ...