AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Delphi Geldrückgabeautomat programmieren, aber wie?
Thema durchsuchen
Ansicht
Themen-Optionen

Geldrückgabeautomat programmieren, aber wie?

Ein Thema von steffi20021 · begonnen am 18. Okt 2005 · letzter Beitrag vom 21. Okt 2005
 
steffi20021

Registriert seit: 18. Okt 2005
8 Beiträge
 
#14

Re: Geldrückgabeautomat programmieren, aber wie?

  Alt 21. Okt 2005, 10:17
So hab mich entschlossen noch mehr über Delphi zu lernen und werd ein bissl Zeit vor meinem Laptop verbringen.

Ich hab jetzt schon ein bissl im Internet geguckt, weil ich einiges nich verstehe, aber hab hauptsächlich Quellcodes gefunden, die mich zwar auch ein bissl weiter gebracht haben aber nich viel.
Mein Problem ist es, dass ich von den meisten Dingen nochnie was gehört habe und somit die Funktionsweise nich verstehe...Also wäre es nett, wenn ihr mir die folgenden Dinge mal kurz erklärt, oder mir ein paar Links gebt *!BITTE!*

Das sind jetzt alles Auszüge aus dem Programm von s14. Hier gleich mal DANKE an s14!

Array [x..y] of ????
Delphi-Quellcode:
Money: Array[0..14] of Cardinal = (50000, 20000, 10000, 5000, 2000, 1000, 500, 200, 100, 50, 20, 10, 5, 2, 1);

Amount: Array[0..14] of Cardinal;
Wenn ich es richtig verstehe is bei Money die 0 für 50000, die 1 für 20000,...
Aber wie is das dann bei Amount?

Delphi-Quellcode:
// Hier wird die Anzahl der einzelnen Zahlungsmittel ermittelt
  while Change > 0 do
  for i := Low(Money) to High(Money) do
    if Change >= Money[i] then
    begin
      Inc(Amount[i]);
      Dec(Change, Money[i]);
      Break;
    end;
Hier wär es nett, wenn ihr mir das Inc, Dec und Break erklärt, vll bringt mich das schon weiter.
Oh und das i steht das für [x..y]?


Delphi-Quellcode:
// Anzeige der einzelnen Labels aktualisieren
  for i := Low(Amount) to High(Amount) do
    case i of
      0: SetLabel(Label_500, Format('%d x 500 €', [Amount[i]]), Amount[i]);
      1: SetLabel(Label_200, Format('%d x 200 €', [Amount[i]]), Amount[i]);
      2: SetLabel(Label_100, Format('%d x 100 €', [Amount[i]]), Amount[i]);
      3: SetLabel(Label_50, Format('%d x 50 €', [Amount[i]]), Amount[i]);
      4: SetLabel(Label_20, Format('%d x 20 €', [Amount[i]]), Amount[i]);
      5: SetLabel(Label_10, Format('%d x 10 €', [Amount[i]]), Amount[i]);
      6: SetLabel(Label_5, Format('%d x 5 €', [Amount[i]]), Amount[i]);
      7: SetLabel(Label_e2, Format('%d x 2 €', [Amount[i]]), Amount[i]);
      8: SetLabel(Label_e1, Format('%d x 1 €', [Amount[i]]), Amount[i]);
      9: SetLabel(Label_c50, Format('%d x 50 Cent', [Amount[i]]), Amount[i]);
      10: SetLabel(Label_c20, Format('%d x 20 Cent', [Amount[i]]), Amount[i]);
      11: SetLabel(Label_c10, Format('%d x 10 Cent', [Amount[i]]), Amount[i]);
      12: SetLabel(Label_c5, Format('%d x 5 Cent', [Amount[i]]), Amount[i]);
      13: SetLabel(Label_c2, Format('%d x 2 Cent', [Amount[i]]), Amount[i]);
      14: SetLabel(Label_c1, Format('%d x 1 Cent', [Amount[i]]), Amount[i]);
    end;
Hier blick ich absolut nich durch...! Also wenn jemand langeweile und lust hat, kann er ja probieren es mir zu erklären

Delphi-Quellcode:
// Die Einstellungen der Labels nach Bedarf setzen
  ALabel.Caption := ACaption;
  if Amount > 0 then
  begin
    ALabel.Font.Color := clRed;
    ALabel.Enabled := True;
  end else
  begin
    ALabel.Font.Color := clWindowText;
    ALabel.Enabled := False;
  end;
Steht hier ALabel für alle Label und muss man das vorher definieren, oder is das immer so?
Oh und was is ACaption?


Ok *** das is jetzt fast das ganze Programm von s14.
Aber wenigstens hab ich mal was, um richtige Fargen zu stellen...

Dann erstma Bye!
Steffi
Nur tote Fische schwimmen mit dem Strom!
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:06 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz