Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi EAccessViolation - finde den Fehler nach langer Suche nicht (https://www.delphipraxis.net/88034-eaccessviolation-finde-den-fehler-nach-langer-suche-nicht.html)

fapsons 9. Mär 2007 07:33


EAccessViolation - finde den Fehler nach langer Suche nicht
 
Hallo Leute,

ich bin ein wenig am verzweifeln. Suche nun seit Stunden den Grund dafür, warum ich direkt nach Programmstart einen EAccessViolation bekomme...

Der Fehler liegt in einer Klasse. Als das Programm noch lief, war sie wie folgt aufgebaut:

Delphi-Quellcode:
Unit DeclareTypes;
...
TSoftwarePaket = class
  private
      Software: TIntArray;
      ...
  protected
      procedure SetSprachVersion(lang: ShortInt);
      ...
  puplic
      property Sprachversion:  ShortInt read GetSprachversion  write SetSprachversion;
      ...
...

procedure TSoftwarePaket.SetSprachVersion(lang: ShortInt);
begin
 case lang of
   1: software[9] := Prims[13]; //Deutsch
   2: software[9] := Prims[14]; //Englisch
 end;
end;
Habe dann gestern Abend folgende Veränderungen durchgeführt, seitdem läuft es nicht mehr:

Delphi-Quellcode:
Unit SetObject Values;
...
 reg := TSoftwarePaket.Create;
 reg.Ac_ID := 0;
...


Unit DeclareTypes;

type
    TCustomer = record
      ID :Integer;
      Company :String;
      CompanyType :String;
      PAdress :String;
      Software :TIntArray;
    end;

TSoftwarePaket = class
  private
      Customer: array of TCustomer;
      ...
  protected
      procedure SetSprachVersion(lang: ShortInt);
      ...
  puplic
      Ac_ID :Integer;
      property Sprachversion:  ShortInt read GetSprachversion  write SetSprachversion;
      ...
...

procedure TSoftwarePaket.SetSprachVersion(lang: ShortInt);
begin
 case lang of
   1: customer[ac_ID].software[9] := Prims[13]; //Deutsch
   2: customer[ac_ID].software[9] := Prims[14]; //Englisch
 end;
end;

Kann mir jemand sagen, was ich falsch mache?


Vielen Dank!
Gruß
-fapsons--

Klaus01 9. Mär 2007 07:38

Re: EAccessViolation - finde den Fehler nach langer Suche ni
 
Warum zweimal?

Grüße
Klaus

fapsons 9. Mär 2007 07:39

Re: EAccessViolation - finde den Fehler nach langer Suche ni
 
Sorry, war beim Klicken wohl etwas zu schnell...;) Das 2. Posting hat keine Bedeutung...

TStringlist 9. Mär 2007 08:16

Re: EAccessViolation - finde den Fehler nach langer Suche ni
 
Hast Du diese dynamische Array "Customer" am Prog-Start auch mit SetLength initialisiert?

Matze 9. Mär 2007 08:19

Re: EAccessViolation - finde den Fehler nach langer Suche ni
 
Ich mache hier mal dicht, da es sich um einen Doppelthread handelt: Hier geht's weiter: http://www.delphipraxis.net/viewtopi...=692849#692849

* C L O S E D *


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:55 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz