Einzelnen Beitrag anzeigen

Gehstock

Registriert seit: 28. Jan 2006
Ort: Görlitz / Sachsen
489 Beiträge
 
Delphi 2007 Professional
 
#1

Problem mit Array

  Alt 9. Feb 2011, 09:43
Delphi-Version: 5
bei meinem Array gibt es ein seltsames Problem
So klappt alles

Delphi-Quellcode:
Const
 Perm : Array [0..5] of Array [1..18] of Integer = (
 (17,18,15,16,13,14,11,12,09,10,07,08,05,06,03,04,01,02), //Dummy
 (17,18,15,16,13,14,11,12,09,10,07,08,05,06,03,04,01,02), ///
 (15,16,17,18,11,12,09,10,07,08,05,06,03,04,01,02,13,14), ///
 (09,10,11,12,13,14,03,04,07,08,05,06,17,18,01,02,15,16), ///
 (11,12,09,10,15,16,13,14,17,18,05,06,01,02,07,08,03,04), ///
 (11,12,09,10,15,16,13,14,17,18,05,06,01,02,07,08,03,04)); //Platzhalter
 MB : Array [0..5] of Array [0..1] of String = (
 ('XX','XX'),// Dummy
 ('8F','BE'),
 ('3C','E2'),
 ('6C','B9'),
 ('74','9A'),
 ('53','AE'));
var
 I : Integer;
 Swapnum,Permnum: String;
begin
...
 for I := 1 to 18 do
 Permnum := Permnum + Swapnum[Perm[cbModel.ItemIndex + 2,i]];
  Result := MB[cbModel.ItemIndex + 2,Mode]+ Swapnum + Swapnum + Permnum;
schreib ich es so kracht es

Delphi-Quellcode:
Const
 Perm : Array [1..5] of Array [1..18] of Integer = (
 (17,18,15,16,13,14,11,12,09,10,07,08,05,06,03,04,01,02), ///
 (15,16,17,18,11,12,09,10,07,08,05,06,03,04,01,02,13,14), ///
 (09,10,11,12,13,14,03,04,07,08,05,06,17,18,01,02,15,16), ///
 (11,12,09,10,15,16,13,14,17,18,05,06,01,02,07,08,03,04), ///
 (11,12,09,10,15,16,13,14,17,18,05,06,01,02,07,08,03,04)); //Platzhalter
 MB : Array [1..5] of Array [0..1] of String = (
 ('8F','BE'),
 ('3C','E2'),
 ('6C','B9'),
 ('74','9A'),
 ('53','AE'));
var
 I : Integer;
 Swapnum,Permnum: String;
begin
...
 for I := 1 to 18 do
 Permnum := Permnum + Swapnum[Perm[cbModel.ItemIndex + 1,i]];
  Result := MB[cbModel.ItemIndex + 1,Mode]+ Swapnum + Swapnum + Permnum;
jemand ne Idee warum denn die Obere Lösung finde ich sehr unschön
Marcel

Geändert von Gehstock ( 9. Feb 2011 um 09:48 Uhr)
  Mit Zitat antworten Zitat