Autor Beitrag
GericasS
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 540

Windows Vista Home Premium
D2010, VisualStudio2008
BeitragVerfasst: Fr 05.10.07 10:30 
Guten Morgen DF (EE),

ich hab mal wieder einer Frage !

Ich möchte mir ein Programm schreiben, was auf eine Eingabe in einem Edit Feld ein bestimmtes Produkt heraussucht.

Beispiel : Die Eingabe in das Editfeld wäre die Artikelnummer 1, diese Nummer würde einem gewissen Produkt entsprechen.
Der Name und der Preis des jeweiligen Produktes soll anschließen auf einem Panel wiedergegeben werden.

Ist es in diesem Falle sinnvoll mit Arrays zu arbeiten für diese Aufzählungen von Produkten ?


GericasS :D

Grüße

_________________
Alexander N.
Neue Bewaffnung Amilo xi2428 T9300
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 05.10.07 10:35 
Wie sieht denn deine Datenverwaltung generell aus? Hast du eine Klasse TProdukt oder ähnlich? Dann würde ich die ganzen Produkte in einer TObjectlist verwalten.

_________________
We are, we were and will not be.
GericasS Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 540

Windows Vista Home Premium
D2010, VisualStudio2008
BeitragVerfasst: Fr 05.10.07 10:38 
Also,

es sieht so aus, ich habe eine Liste von verschiedenen Geräten mit jeweils einer Artiklenummer und einem Preis und diese sollen wie schon erwähnt ausgegeben werden
bei eingabe einer bestimmen artikelnummer !

Hoffe das beantwortet deine Frage !:D

_________________
Alexander N.
Neue Bewaffnung Amilo xi2428 T9300
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 05.10.07 10:47 
Naja, wenn du deine Geräte in einer Liste hast, dann geh die Liste doch einfach in einer Schleife durch, überprüfe die Artikelnummer und gib dann die anderen Eigenschaften des passenden Gerätes in einem Label oder sonstwo aus.

_________________
We are, we were and will not be.
GericasS Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 540

Windows Vista Home Premium
D2010, VisualStudio2008
BeitragVerfasst: Fr 05.10.07 10:58 
Ja,

das wäre auch eine Möglichkeit, wollte halt nur mal wissen ob es auch anderst geht !

_________________
Alexander N.
Neue Bewaffnung Amilo xi2428 T9300
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Fr 05.10.07 11:01 
Um wieviele Datensätze geht es denn ? Weniger als 100 ? Ansonsten machen Listen etc. kaum Sinn.

_________________
Gruß
Hansa
GericasS Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 540

Windows Vista Home Premium
D2010, VisualStudio2008
BeitragVerfasst: Fr 05.10.07 11:07 
Es handelt sich zu Anfang gerade mal um 5 Produkte kann aber mehr werden !

_________________
Alexander N.
Neue Bewaffnung Amilo xi2428 T9300
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Fr 05.10.07 11:12 
Wieviel denn mehr ?

_________________
Gruß
Hansa
GericasS Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 540

Windows Vista Home Premium
D2010, VisualStudio2008
BeitragVerfasst: Fr 05.10.07 11:12 
also höchstes 20 !

_________________
Alexander N.
Neue Bewaffnung Amilo xi2428 T9300
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Fr 05.10.07 13:01 
Ich würde da ein Array of record nutzen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
type
  TProdukte = record
    Artikelname: String;
    Preis: Integer;
  end;

var
  Produkte: Array[1..5] of TProdukte;
begin
  Produkte[1].Artikelname := 'Delphi 2007';
  Produkte[1].Preis := 1000;

  { ... }
end;

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
GericasS Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 540

Windows Vista Home Premium
D2010, VisualStudio2008
BeitragVerfasst: Fr 05.10.07 14:11 
Hey GTA-Place ich danke dir für diesen super Vorschlag werds gleich ausprobieren und mich dann nochmal melden !

_________________
Alexander N.
Neue Bewaffnung Amilo xi2428 T9300