Autor Beitrag
dr. rom4o
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 59


TMT-Pascal, D3 Prof, C++Builder
BeitragVerfasst: Di 08.06.04 12:52 
In Turbopascal konnte man Zahlen
beispielsweise auf 8 Stellen vor das Komma(Integerzahlen)
so konvertieren:
ausblenden Quelltext
1:
2:
3:
var b : integer; 
...
write(b:8);

dann wurde die Zahl nicht so
8________
sondern so
________8
ausgegeben.
Wie geht das in Delphi?

mfg

dr. rom4o

_________________
Sei frei!!! ...doch eigentlich bist du es nie...denn Alles ist determiniert
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 08.06.04 16:31 
Kuck mal in der Delphhi Hilfe nach Format.
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Di 08.06.04 18:55 
in allen D Version genauso, weil ist Standard-Pascal.
grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
dr. rom4o Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 59


TMT-Pascal, D3 Prof, C++Builder
BeitragVerfasst: Di 08.06.04 20:10 
danke für die info

dr. rom4o

_________________
Sei frei!!! ...doch eigentlich bist du es nie...denn Alles ist determiniert
dr. rom4o Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 59


TMT-Pascal, D3 Prof, C++Builder
BeitragVerfasst: Mi 09.06.04 00:14 
Titel: ohoh
tut mir leid aber ich habe es probiert wie in TP
doch es funktioniert nicht.
wieso geht dass nicht?
In der Hilfe habe ich unter Format gesucht doch werde daraus nicht schlau

dr. rom4o...

_________________
Sei frei!!! ...doch eigentlich bist du es nie...denn Alles ist determiniert
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Mi 09.06.04 12:25 
Hallo,

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  var b:integer; 
  ...
  b:=12;
  Label1.Caption:=Format('%8d', [b]);
  ...


Sauber formatiert wird allerdings nur, wenn vorher der Fontname auf MS Courier New od. ähnliche umgestellt wird.

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Mi 09.06.04 18:00 
Write(ln) benutzt die Standard-Ausgabe. Wo geht denn deine Ausgabe hin? Consolenanwendung?
grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
dr. rom4o Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 59


TMT-Pascal, D3 Prof, C++Builder
BeitragVerfasst: Mi 09.06.04 22:34 
Titel: Problem
Also tut mir ja leid aber es hat garnichts geklappt...
ich habe es so probiert, mit einem Button in hein Label und in ein Memo zu
kopieren bzw. zu konvertieren.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure Ttexttool1.zahlkonvertClick(Sender: TObject);
begin
     case schalter of
         true  :  begin
                       //Memo1.Lines[0]:=Memo1.Lines[0]+IntToStr(7:9);
                  end;
         false :  begin
                       Label2.Caption:=Format('%8d', [8]);
                       //Memo1.Lines.Add(8:7);
                  end;
     end;
end;

die Routine hat nicht wirklich einen Sinn.
Dient nur zu Übungszwecken, aber ich denke man kann verstehen was ich erreichen wollte.

dr. rom4o


Moderiert von user profile iconPeter Lustig: Code- durch Delphi-Tags ersetzt.

_________________
Sei frei!!! ...doch eigentlich bist du es nie...denn Alles ist determiniert
dr. rom4o Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 59


TMT-Pascal, D3 Prof, C++Builder
BeitragVerfasst: Do 10.06.04 14:11 
was ist denn ab dem Quelltext oben falsch?

_________________
Sei frei!!! ...doch eigentlich bist du es nie...denn Alles ist determiniert