Autor Beitrag
uetzenknueff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Mi 28.03.07 16:01 
Guten Tag

ich habe mir das Programm von Narsus angeguckt jedoch funktioniert comparevalue nicht!
sein quelltext

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
implementation

{$R *.DFM}
 uses math;
procedure TForm7.lvHighscoreCompare(Sender: TObject; Item1, Item2: TListItem;
  Data: Integer; var Compare: Integer);
begin
   Compare := CompareValue(Integer(Item2.Data),Integer(Item1.Data));
end;

procedure TForm7.Button1Click(Sender: TObject);
begin
  with lvHighscore.Items.Add do begin // neuen Highscore-Eintrag machen (auto-sortiert!)
    Caption := 'Narses'; // Name eintragen
    Data := Pointer(Random(100)); // Punktestand zum Sortieren
    SubItems.Add(IntToStr(Integer(Data))); // und für die Ausgabe
    SubItems.Add(DateTimeToStr(Now)); // Datum eintragen
end;
end;


[Fehler] Unit7.pas(32): Undefinierter Bezeichner: 'CompareValue'

math ist eingebunden warum geht das dann nicht?
genauso auch bei dem DemoProg von Narsus der funzt auch net
www.delphi-library.d...Highscore_70217.html

need HELP plz
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Mi 28.03.07 16:42 
Welche Delphi-Version hast du? Möglich, dass in deiner Version nicht die 'aktuelle' math.dcu / math.pas drin ist...

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
uetzenknueff Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Mi 28.03.07 16:44 
ich hab Delphi 5 , brauch aber ganz dringend die aktuelle Math unit
kannst du mir die schicken? oder gibs die irgendwo zum Download?
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Mi 28.03.07 16:55 
Das ist verboten! :mahn: Du musst sie dir 'anders' besorgen ... :(

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Mi 28.03.07 17:20 
user profile iconuetzenknueff hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
implementation

{$R *.DFM}
 uses math;

Schätze, die Unit muss so eingebunden werden:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, math;


Per PN hast du ja mitgeteilt, dass er sonst nach der Unit PfadDesProgramms\math.pas sucht.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 28.03.07 17:21 
user profile iconJayEff hat folgendes geschrieben:
Per PN hast du ja mitgeteilt, dass er sonst nach der Unit PfadDesProgramms\math.pas sucht.


Daher der Hinweis an user profile iconuetzenknueff: Problemlösungen werden im Forum besprochen und nicht per PN! :mahn:

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
uetzenknueff Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Mi 28.03.07 17:22 
joar also ich hab die unit math jetzt zufällig gefunden und trotzdem kommt immer noch:
[Fehler] Unit7.pas(32): Undefinierter Bezeichner: 'CompareValue'

woher kommt das?
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Mi 28.03.07 17:23 
user profile iconChristian S. hat folgendes geschrieben:
Daher der Hinweis an user profile iconuetzenknueff: Problemlösungen werden im Forum besprochen und nicht per PN! :mahn:
Drum hab ichs hier nochmal gepostet :)
Zu deinem neuen Problem: Sicher, dass du die math.dcu, die dir wohl irgendwie ( :gruebel: ) zugeflogen ist, in den Borland\Delphi 5\Lib\ Ordner gelegt und die alte math.dcu, die dort war, irgendwo anders gespeichert hast?

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
uetzenknueff Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Mi 28.03.07 17:27 
ja habs so gemacht allerdings kommt das gleiche. :-(
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Mi 28.03.07 17:28 
user profile iconuetzenknueff hat folgendes geschrieben:
ja habs so gemacht allerdings kommt das gleiche. :-(

:gruebel: Damit bin ich dann überfragt :( Bei mir (Delphi 7 Enterprise) gibts die CompareValue Funktion...

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
ub60
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 765
Erhaltene Danke: 130



BeitragVerfasst: Mi 28.03.07 18:08 
Auch ohne CompareValue gibt es verschiedene Möglichkeiten. Hier mal zwei:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
  if Integer(Item2.Data)<Integer(Item1.Data)
    then Compare :=-1
    else if Integer(Item2.Data)=Integer(Item1.Data)
      then Compare :=0
      else Compare :=1;}
  { oder }
  Compare:=Sign(Integer(Item2.Data)-Integer(Item1.Data))


Viel Spaß!
ub60
uetzenknueff Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Mi 28.03.07 18:15 
lol jetzt geht garnix mehr :-(

hab die unit in Lib gemacht und jetzt kommt immer [Fataler Fehler] Datei nicht gefunden: 'd:\programme\delphi\delphi5\Lib\Math.pas'

OBWOHL ich math nirgendwo im Programm eingebunden hab!

plz help das Programm muss funzen!

[edit] so: wenn ich Math komplett raus mache aus Lib kommt das: Math.dcu nicht gefunden wird

Und wenn ich die alte unit reinmache wieder in lib kommt: [Fataler Fehler] Ausgabedatei 'D:\Programme\Delphi\Delphi5\PROJEKT!!!!\Project1.exe' kann nicht erstellt werden

mehr net? ka warum! bitte hilfe
OSI.create(self)
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Mi 26.03.08 14:19 
hi
Ich hab das selbe Problem
könntest mir nicht einfach die Funktion aus der Unit Math (aus delphi 2007) kompieren ich bau se mir selber ein dann is der Fehler weg

wär cool

mfg
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 26.03.08 14:22 
user profile iconOSI.create(self) hat folgendes geschrieben:
könntest mir nicht einfach die Funktion aus der Unit Math (aus delphi 2007) kompieren ich bau se mir selber ein dann is der Fehler weg
Wenn Du vorher die Erlaubnis von CodeGear einholst, kann das jemand machen, ansonsten ist das wohl nicht erlaubt.

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mi 26.03.08 15:06 
Moin!

In dem Tut ist doch eine Alternative ohne die Math-Unit angegeben... :nixweiss: :idea: ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.