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

Windows Vista Home Premium
D2010, VisualStudio2008
BeitragVerfasst: Di 09.10.07 09:32 
Hey,

hat das noch einen tieferen Sinn außer, das es übersichtlicher wird ?
Also mir kommt es vor als wäre dann das hinzufügen von weiteren Artikeln einfach zu schreiben. Anyway danke dir für den Tipp werds gleich versuchen !

Grüße

_________________
Alexander N.
Neue Bewaffnung Amilo xi2428 T9300
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Di 09.10.07 10:59 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure TframeLauf.TestClick(Sender: TObject);
const
  coArtikel: array[1001..1002of array[0..1of String
           = (('Monitor Fujitsu-Siemens','199,99€'),
              ('Festplatte 250 GB','89,50€')
             );
var
  Zahl: Integer;
begin
 Zahl := 1001;
  if (Zahl>=Low(coArtikel)) and (Zahl<=High(coArtikel)) then
    begin
      Panel1.Caption := coArtikel[Zahl,0];
      Panel2.Caption := coArtikel[Zahl,1];
    end
  else ShowMessage('Falsche Eingabe');
end;

so spart man noch eine Procedure und das Erweitern wird noch einfacher!

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 480

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 09.10.07 11:04 
Das ist mal wieder so ein Optimierungs-Thread, was? Eine ganz triviale Frage, und zwei Seiten Diskussion. :lol:

Los jetzt - ich will noch ne Assembler-Variante sehen!

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

Windows Vista Home Premium
D2010, VisualStudio2008
BeitragVerfasst: Di 09.10.07 11:39 
Oh,

ich danke ja schon recht herzlich für die ganzen Optimierungen aber ich kann das doch alles noch gar nicht anwenden xD ^^

_________________
Alexander N.
Neue Bewaffnung Amilo xi2428 T9300