AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Exception beim SetLength für ein Array

Ein Thema von nwnssolutionssoftware · begonnen am 31. Aug 2020 · letzter Beitrag vom 31. Aug 2020
 
nwnssolutionssoftware

Registriert seit: 6. Aug 2018
45 Beiträge
 
#1

Exception beim SetLength für ein Array

  Alt 31. Aug 2020, 10:08
Hallo Community,
leider habe ich mal wieder ein kleines Problem...
Ich bekomme beim SetLength eine Excpetion. Nutze aktuell dafür Lazarus vllt. kann mir ja jemand helfen

Hier mal kurz der Aufbau des Objektes...
Code:
  TConnection = class
    Name            : String;
    Unterverbindung : Boolean;
    ID              : String;
    User            : String;
    Pass            : String;
    UName           : String;
    UVorName        : String;
    Hauptcon        : String;
    repeaterip      : String;
    LetzteVerbindung : String;
    Image           : TPicture;
    Notes           : String;
    PCDATA          : String;
    Telefon         : String;
    procedure Clear;
    procedure Laden(dConnections: TDataSet);
    procedure Speichern(dConnections: TDataSet);
  end;

type

  { TConnectionListe }

  TConnectionListe = class
    Items : Array of TConnection;
    procedure Clear;
    function Count:Integer;
    procedure Laden(dConnections : TDataSet);
    procedure SearchUnterCon(ID: String);
    procedure Speichern(dConnections : TDataSet);
  end;
Hier der Quellcode mit dem SetLength wo die Exception auftritt.

Code:
procedure TConnectionListe.Laden(dConnections: TDataSet);
var n : Integer;
begin
  if not dConnections.Active then dConnections.Open;
  dConnections.First;
  SetLength(Items, 100000);         <<<---- Hier tritt der Fehler auf
  n := 0;
  while not dConnections.EOF do
  begin
    Items[n].Laden(dConnections);
    Inc(n);
    dConnections.Next;
  end;
  SetLength(Items, n);
end;
Holger
  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 22:21 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz