Autor Beitrag
claudi89
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: So 22.01.06 16:25 
hilfe kann mir mal jemand sagen warum delphi hier eine fehlermeldung ausgibt (zeile 14)(operator not applicable to this operand type) ziel dieser funktion soll sein, eine aufgabe mit dezimalzahlen zu bekommen, in der ein ergebnis mit rest null rauskommt.


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
begin
  Randomize;

    Zahl1:=(random(10000)+1)/100 ;
    Zahl2:=(random(10000)+1)/100;

  while (Zahl1 < Zahl2) do
  begin
     Zahl1:=(random(10000)+1)/100 ;
     Zahl2:=(random(10000)+1)/100;
  end;

begin
      Erg      := Zahl1 DIV Zahl2;
       Zahl1   := Erg * Zahl2;
       RZeichen := '/';
    end;


danke schon mal für eure antworten


Moderiert von user profile iconGausi: Topic aus Sonstiges (Delphi) verschoben am Mi 25.01.2006 um 10:51
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Mi 25.01.06 11:34 
Wie hast du die Variablen Zahl1, Zahl2 und Erg definiert? Sprich: von welchem Typ sind diese Variablen?

Lg Martin

_________________
Ein Nutzer der Ecke ;-)
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 25.01.06 11:50 
Hallo,

Ich habe hier mal zugemacht, weil du vor kurzem schonmal ein Thema dazu aufgemacht hast. Das kann man ruhig hier weiterdiskutieren.
Evtl. solltest du dich auch mal mit user profile iconalex13 unterhalten (vielleicht in der 5-Minuten-Pause, oder wenn der Lehrer mal nicht zuhört ;-)). Der scheint an der gleichen Aufgabe zu arbeiten. Zumindest legt das diese seltsame Random-Konstruktion sehr nahe.

_________________
We are, we were and will not be.
Dieses Thema ist gesperrt, Du kannst keine Beiträge editieren oder beantworten.

Das Thema wurde von einem Team-Mitglied geschlossen. Wenn du mit der Schließung des Themas nicht einverstanden bist, kontaktiere bitte das Team.