Autor Beitrag
PreMarT
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 57

Work: Win XP ; Home: Win Vista 64-Bit

BeitragVerfasst: Fr 18.09.09 10:38 
Hi alle zusammen,

diesmal hab ich erst gesucht aber leider nicht gefunden was mir geholfen hat.

Ich hab folgendes Problem ich hab da ein "record" mit 15 unterschiedlichen variablen (entspricht den Spalten aus meiner Excel Tabelle) nun möchte ich aus der Excel Tabelle die einzelnen Spalten in das Record lesen, dafür brauch ich noch ein Array das sozusagen die Zeilen wiedergibt dann soll das Prog die Zeilen in das Array und Record schreiben so das ich später alle Zeilen und Spalten in dem Array hab.

Mir geht es darum das ich nicht weis wie ich das record in ein Array übergebe...Ich hoffe ich konnte mich klar ausdrücken...

wenn nicht einfach fragen :/

MFG PMT
Tastaro
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 414
Erhaltene Danke: 23



BeitragVerfasst: Fr 18.09.09 10:48 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
type
   tmyrecord = record
                  Wert1: interger;
                  Wert2: integer;
               end;
   tarray_of_myrecord: array[0..99of tmyrecord;


Beste Grüße
PreMarT Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 57

Work: Win XP ; Home: Win Vista 64-Bit

BeitragVerfasst: Fr 18.09.09 10:55 
Danke schonmal, nur wie sprech ich die einzelnen Felder von meinem Record in den einzelnen Arrays jetzt an?
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Fr 18.09.09 15:16 
Meinst du das?
ausblenden Delphi-Quelltext
1:
MyArrayOfRecord[23].Wert1 := 1337;					

_________________
PROGRAMMER: A device for converting coffee into software.
Hugo343
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 114
Erhaltene Danke: 2

Windows 7
Turbo Delphi, Dev C++
BeitragVerfasst: Fr 18.09.09 16:16 
Ich mach das eigentlich immer so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
type
  TMeinArray = array[0..9of record
    Wert1:integer;
    Wert2:integer;
  end;

var
  MeinArray:TMeinArray;


^^
Tryer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 226
Erhaltene Danke: 7



BeitragVerfasst: Fr 18.09.09 16:19 
Ungünstig, wenn man mal einen einzelnen Record als Parameter übergeben will. Den Recordtyp sollte man also besser einzeln deklarieren.
PreMarT Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 57

Work: Win XP ; Home: Win Vista 64-Bit

BeitragVerfasst: Fr 18.09.09 16:37 
Also ich mein das z.B. so:


ausblenden Quelltext
1:
edtAusgabe := MyRecord.Ort aus dem 5ten Array					



Sorry ich hab noch nie Records benutzt :/
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Fr 18.09.09 20:24 
user profile iconPreMarT hat folgendes geschrieben Zum zitierten Posting springen:
Also ich mein das z.B. so/


Äh ja, siehe oben. Nur, dass du halt nich den Wert reinschreibst, sondern ausliest.

_________________
PROGRAMMER: A device for converting coffee into software.
PreMarT Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 57

Work: Win XP ; Home: Win Vista 64-Bit

BeitragVerfasst: Sa 19.09.09 12:30 
Alles klar ich danke euch :)