Autor Beitrag
gerd99
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Do 30.04.20 15:31 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
var
z:uint64;

label1.Caption:=inttostr(z);


inttostr scheint hier bei der Umwandlung von uint64 nicht mehr zu gehen. Was soll ich hernehmen?

Gerd
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4700
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: Do 30.04.20 15:47 
gerd99 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Do 30.04.20 15:52 
Nein, das nimmt er nicht an. Logisch wäre uint64tostr aber das geht auch nicht.

Gerd

Moderiert von user profile iconTh69: Delphi-Tags hinzugefügt
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8535
Erhaltene Danke: 473

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Do 30.04.20 16:12 
Bei mir zeigt dieser Code
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var z: UInt64;
begin
    z := High (UInt64);
    showmessage(UIntToStr(z));
end;

den erwarteten Wert von 18.446.744.073.709.551.615 an (ohne die Punkte natürlich). Probiert mit Delphi 2009 und der aktuellen CE.

Was passiert denn bei dir?

_________________
We are, we were and will not be.
gerd99 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Do 30.04.20 16:45 
Bir mir zeigt er nur 4294967295 an. Ich habe aber als Zielplattform 64 bit gewaehlt.

Gerd
LorenzS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128

MS-DOS, WIN 7, WIN 10
BP7.0, D3, D5
BeitragVerfasst: Do 30.04.20 17:16 
Mit was und wie befüllst du z?

Zitat:
Ich habe aber als Zielplattform 64 bit gewaehlt.

Zielplattform hat nichts mit den Datentypen zu tuen, die gibt es auch bei 32-Bit Anwendungen.
64Bit Plattform nimmt man wenn das Programm 2 GB Arbeitsspeicher verbraucht.
gerd99 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Do 30.04.20 17:16 
Halt, NUR bei dem Beispiel habe ich mich vertippt und uint bloss eingegeben.
Also das zeigt er bei mir auch an.

Aber nachwievor, weiss ich nicht, wie ich die Zahl in einen String umwandele.

Gerd
gerd99 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Do 30.04.20 17:24 
aha, mit Uinttostr funktioniert es, sehe ich gerade.
gerd99 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Do 30.04.20 18:00 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure BitSet(var TestZahl :uint64; bitnr:uint64);
begin
    TestZahl:= testzahl OR (1 shl BitNr);
end;

procedure TForm1.start;
var z:uint64;
begin
  z:=0;
  //z := High (UInt64);
  bitset(z,32);
  showmessage(UIntToStr(z));
  edit1.text:=(UIntToStr(z));
  label1.Caption:=uinttostr(z);

end;


Warum kommt jetzt bei z die Zahl 1 raus. Ich sage doch, es muss doch eine ganz grosse Zahl rauskommen? Ich komme da nicht ganz mit.

Gerd
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8535
Erhaltene Danke: 473

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Do 30.04.20 18:57 
Da musst du die 1 auf eine 64-Bit-Zahl casten
ausblenden Delphi-Quelltext
1:
TestZahl:= testzahl OR (UIint64(1shl BitNr);					

_________________
We are, we were and will not be.
gerd99 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Do 30.04.20 19:34 
Danke, und jetzt wo ich es sehe erinnere ich mich auch wieder daran. Aber ich waere von alleine nicht drauf gekommen.

Gerd