Autor Beitrag
LonghornUser
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Do 31.07.03 16:23 
Hallo.
Ich habe hier eine Byte-Ausgabe meines freien Festplatten speichers, jedoch wäre es besser 353320960 in MB anzeigen zu lassen, oder ? :lol:

Nur wie mache ich das mit Delphi ??

Danke im vorraus. ciao
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Do 31.07.03 16:30 
Moin...

ausblenden Delphi-Quelltext
1:
MBcount := byteCount / 1024 / 1024;					


:D

_________________
mfg.
mâximôv
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Do 31.07.03 16:54 
:oops: Stimmt :oops: :lol:

Aber da ist noch ein Problem:
Ich habe das Ergebnis als sehr große Zahl vorliegen, die einen Integer übersteigen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
var 
  free_size, total_size: Int64;
       s:char;
       i:integer;
begin

if GetDiskSize(s, free_size, total_size) then begin
i:=free_size / 1024 / 1024;


Und in der letzten Zeile liegt das Problem:

Zitat:
"Incompatible Types: 'Integer' and 'Extend'" (Inkompatible Typen) 8)

Was mache ich nun? Man mus immer bedenken, dass man keinen Integer nehmen kann, da die Byteanzahl manchmal einen Integer übersteigen würden.

Hilfe?

Moderiert von user profile iconTino: Delphi- & Quote-Tags hinzugefügt.
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: Do 31.07.03 17:29 
Wie wäre ein Extended anstatt dem Int64?

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
mirage228
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 338

Win 7 Prof.
Delphi 2005 Prof., Delphi 2010 Prof.
BeitragVerfasst: Do 31.07.03 17:30 
deklariere "i" mal als "Extended"

sollte gehen

mfG
mirage228

_________________
May the source be with you, stranger.
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Do 31.07.03 18:00 
das geht super. die rechnung geht jetz.

Aber wie bringe ich das Extendend jetz wieder in ein label also in einen integer oder einen string ?
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Do 31.07.03 18:10 
auch mit intToStr !!! oder etwa nicht ?

_________________
In the beginning was the word.
And the word was content-type: text/plain.
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Do 31.07.03 20:09 
Nein ! Leider nicht so einfach. Er sagt:

Zitat:
[Error] Unit1.pas(115): There is no overloaded version of 'IntToStr' that can be called with these arguments
[Error] Unit1.pas(116): There is no overloaded version of 'IntToStr' that can be called with these arguments

Was kann ich jetzt tun ?? Weiß nicht mehr so recht weiter !!

Moderiert von user profile iconTino: Quote-Tags hinzugefügt.
UC-Chewie
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 531

WinXP
D5 Ent
BeitragVerfasst: Do 31.07.03 20:10 
Extended ist kein Integer- sondern ein Floattyp. Also FloatttoStr.

_________________
Egal wie dumm man selbst ist, es gibt immer andere, die noch dümmer sind
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Do 31.07.03 20:15 
Hi,

und damit alles perfekt ist machste:

ausblenden Delphi-Quelltext
1:
2:
3:
uses Math;
[...]
Label1.Caption:=FloatToStr(RoundTo(i,-2));


Damit zeigste nur 2 Stellen nach dem Komma an.

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Fr 01.08.03 09:58 
Suuper. Ich wusste all das nicht, weil ich Informatik in meiner Schule leider nicht machen kann, weil kein Kurs zustande kommen wird schätz ich mal. :x Aber wer weiß vielleicht ja doch.

Deshalb: DANKE Alles funktioniert nun