Autor Beitrag
Cruiser23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: So 06.06.04 17:57 
Kann mir wer erklären, wieso diese zwei funktionen nich miteinander wollen?

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
function RoundToPointPosition(Number : Extended; PointPos : Byte): Extended;
begin
 Result := StrToFloat(FloatToStrF(Number, ffNumber, 10, PointPos));
end;

function GetzInfo: String;
var
  Memory: TMemoryStatus;
  Ram, FreeRam, Outlay,
  FreeOutlay: Real ;
  begin
    GlobalMemoryStatus(Memory);       

    //Arbeitsspeicher
    Ram         := Memory.dwTotalPhys div 1048576;  
      Ram            := RoundToPointPosition(Ram(#crs), 4);// Fehler; Corsor steht bei(#crs)
    //Freier Arbeitsspeicher
    FreeRam     := Memory.dwAvailPhys div 1048576;
      FreeRam        :=  RoundToPointPosition(FreeRam(#crs), 4);// Fehler; Corsor steht bei(#crs)
    //Größte Größe der Auslagerungsdatei
    Outlay      := Memory.dwTotalPageFile div 1048576;
      Outlay         :=  RoundToPointPosition(Outlay(#crs), 4);// Fehler; Corsor steht bei(#crs)
    //Freier Platz der Auslagerungsdatei
    FreeOutlay  := Memory.dwAvailPageFile div 1048576;
      FreeOutlay     :=  RoundToPointPosition(FreeOutlay(#crs), 4);// Fehler; Corsor steht                                                                            // bei(#crs)

    Result := FloatToStr(Ram)        + 'Ram'       +
              FloatToStr(FreeRam)    + 'FreeRam'   +
              FloatToStr(Outlay)     + 'Outlay'    +
              FloatToStr(FreeOutlay) + 'FreeOutlay';
  end;

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!


Zuletzt bearbeitet von Cruiser23 am So 06.06.04 19:07, insgesamt 1-mal bearbeitet
UC-Chewie
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 531

WinXP
D5 Ent
BeitragVerfasst: So 06.06.04 18:32 
Was wollen die nicht miteinandern tun?
Wäre ganz sinnvoll, wenn du uns erklären könntest, was genau dein Problem ist.

_________________
Egal wie dumm man selbst ist, es gibt immer andere, die noch dümmer sind
Cruiser23 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: So 06.06.04 18:38 
Ich hebe kein Delphi hier, aber die Fehlermeldung hies irgendiwie so:
bla is not a float voilent point!

Bla steht für(ram, FreeRam....)

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
UC-Chewie
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 531

WinXP
D5 Ent
BeitragVerfasst: So 06.06.04 19:03 
Dann poste mal die Zeile, in der die Fehlermeldung auftritt.

_________________
Egal wie dumm man selbst ist, es gibt immer andere, die noch dümmer sind
Cruiser23 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: So 06.06.04 19:08 
Siehe geposteter Code oben ^ !

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
UC-Chewie
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 531

WinXP
D5 Ent
BeitragVerfasst: So 06.06.04 19:40 
Ups... :oops:

Ok, was soll der Code machen? Was soll das, dass du deine Real-Variablen wie eine Funktion benutzt? Und was sollen die #crs?

_________________
Egal wie dumm man selbst ist, es gibt immer andere, die noch dümmer sind
Cruiser23 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: So 06.06.04 19:45 
Ok

GetzInfo holt die aktuellen Werte dür vorhandenen/verfügbaren Arbeitsspeicher und vorhandene/verfügbare Auslagerungsdatei)

die andere Funktion Rundet mir die gebrachten werte auf x stellen hinter dem ","

(#crs) steht für CURSOR und symboliesiert die stelle, an der der Cursor Steht!

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
UC-Chewie
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 531

WinXP
D5 Ent
BeitragVerfasst: So 06.06.04 20:31 
Cruiser23 hat folgendes geschrieben:
(#crs) steht für CURSOR und symboliesiert die stelle, an der der Cursor Steht!


Ach so!!

In dem Record stehen Ganzzahlwerte. Du führst dann eine ganzzahlige Division durch. Das Ergebnis davon ist also wieder ganzzahlig. Warum benutzt du dann Real?

_________________
Egal wie dumm man selbst ist, es gibt immer andere, die noch dümmer sind
Cruiser23 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: So 06.06.04 20:36 
IN welchem Record? Was für ganzzahlen? der liefert mir ne zahl mit 6 stellen.
RoundToPointPosition soll mir die Zahl auf zb 4 stellen runden.

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
Cruiser23 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: Mi 09.06.04 15:28 
<------------ Ein kleiner Push....

Sorry Leute, aber is mir echt wichtiig, komme sonst nich wirklich in minem Prog weiter!!!
Hat echt keiner n schimmer, warums nicht klappt?

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
iGoA
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 103

Alle Win´s
D5 Prof
BeitragVerfasst: Mi 09.06.04 15:34 
Wieso benutzt Du "div" und nicht einfach "/"? DIV ist der Divisionsoperator für GANZZAHLEN und gibt immer eine gerundete GANZZAHL zurück. Also nix mit 6 Nachkommastellen.

_________________
"Diner for One" objektorientiert:
"The same method as last year, Ms. Sophie?" (was für´n Schwachsinn)
iGoA
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 103

Alle Win´s
D5 Prof
BeitragVerfasst: Mi 09.06.04 15:53 
Was soll der Ausdruck Ram(#crs) ergeben? Ne Variable und Klammern dahinter?

_________________
"Diner for One" objektorientiert:
"The same method as last year, Ms. Sophie?" (was für´n Schwachsinn)
obbschtkuche
Gast
Erhaltene Danke: 1



BeitragVerfasst: Mi 09.06.04 16:03 
Cruiser23 hat folgendes geschrieben:
(#crs) steht für CURSOR und symboliesiert die stelle, an der der Cursor Steht!


[besserwiss]Zur Not gibts auch noch den "Edit"-Button, wenn man was vergessen hat ;)[/besserwiss]
Cruiser23 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: Mi 09.06.04 16:10 
Nu bin ich verwirrt. Wenn ich die Orginalfunction benutze (EDH) dann liefert er mir zb für Ram 511,?????? und in der Originalen wird auch div benutzt!

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
obbschtkuche
Gast
Erhaltene Danke: 1



BeitragVerfasst: Mi 09.06.04 16:14 
Deklarier Mal testweise die Variablen als Extended und poste mal den genauen Wortlaut der Fehlermeldung
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 09.06.04 16:22 
Also erstmal ist da nix mit Nachkommastellen, da du eine Ganzzahldivision durchführst. Und wie wäre es die Werte gleich mit Format zu formatieren?
Cruiser23 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: Mo 14.06.04 20:26 
@obbschtkuche:
Hier ist die Fehlermeldung (Tritt bei der Deklaration als Real wie auch als Extended auf):
ausblenden Delphi-Quelltext
1:
2:
3:
Project Bla.exe raised Exception class
EConvertError with message "1.250,0000" is
not a valid floating value'. Process stopped. . .


@Luckie:
Format :shock: ?
Werd ich mich mal zu umsehen!

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!