Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Problem beim Erstellen einer klasse (https://www.delphipraxis.net/79558-problem-beim-erstellen-einer-klasse.html)

mkinzler 25. Okt 2006 17:58

Re: Problem beim Erstellen einer klasse
 
Jein. Es ist kein Platzhalter/Makro, sondern ein Unterprogramm, welches aufgerufen wird und einen Wert zurückliefert.

Axxus 25. Okt 2006 18:41

Re: Problem beim Erstellen einer klasse
 
JO heißt im KLartext

Sobald das Programm zu einer funktion kommt springt es dorthin berechnet was und das ergebniss gibt es dann an der stelle zurück *bling* *Kronleuchter angegangen*
ok danke
hab jetzt wieder ien problem
Es rtitt wieder ein Exeption auf

Delphi-Quellcode:
unit Matrix_Windows_Controler_Quelltext;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TKonsole_Form = class(TForm)
    Konsole_Edit: TEdit;
    Konsole_Memo: TMemo;
    Konsole_Button: TButton;
    procedure FormCreate(Sender: TObject);
    procedure FormDesrtoy(Sender: TObject);
    procedure Konsole_ButtonClick(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

type
  TFormelsammlung = class(TObject)
    {Variablen}
     Var_Konsole_Layout_Form_color_Background,
     Var_Konsole_Layout_Form_color_Background_Change1,
     Var_Konsole_Layout_Form_color_Background_Change2,
     Var_Konsole_Layout_Form_color_Background_Change3,
     Var_Konsole_Layout_Memo_color_Background,
     Var_Konsole_Layout_Memo_color_Background_Change1,
     Var_Konsole_Layout_Memo_color_Background_Change2,
     Var_Konsole_Layout_Memo_color_Background_Change3 : String;
     Konsole_Memo: TMemo;

    {Methoden}
    Constructor Create;
    procedure Set_Konsole_Layout_Form_color_Background (Txt: String);
    function Get_Konsole_Layout_Form_color_Background : String;
    procedure Set_Konsole_Layout_Memo_color_Background (Txt: String);
    function Get_Konsole_Layout_Memo_color_Background : String;

  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Konsole_Form: TKonsole_Form;
  Formelsammlung: TFormelsammlung;
  Eingabe : String;

implementation

{$R *.dfm}

Constructor TFormelsammlung.Create;
begin
  inherited Create;
end;

procedure TFormelsammlung.Set_Konsole_Layout_Form_color_Background(Txt: string);
begin
  Var_Konsole_Layout_Form_color_Background := (Txt);
  Var_Konsole_Layout_Form_color_Background_Change1 := copy(Var_Konsole_Layout_Form_color_Background, 1, 2);
  Var_Konsole_Layout_Form_color_Background_Change2 := copy(Var_Konsole_Layout_Form_color_Background, 3, 2);
  Var_Konsole_Layout_Form_color_Background_Change3 := copy(Var_Konsole_Layout_Form_color_Background, 5, 2);
  Var_Konsole_Layout_Form_color_Background := '$' + Var_Konsole_Layout_Form_color_Background_Change3 + Var_Konsole_Layout_Form_color_Background_Change2 + Var_Konsole_Layout_Form_color_Background_Change1;
end;

function TFormelsammlung.Get_Konsole_Layout_Form_color_Background;
begin
  Konsole_Form.Color := (stringtocolor (Var_Konsole_Layout_Form_color_Background));
end;

procedure TFormelsammlung.Set_Konsole_Layout_Memo_color_Background(Txt: string);
begin
  Var_Konsole_Layout_Memo_color_Background := (Txt);
  Var_Konsole_Layout_Memo_color_Background_Change1 := copy(Var_Konsole_Layout_Memo_color_Background, 1, 2);
  Var_Konsole_Layout_Memo_color_Background_Change2 := copy(Var_Konsole_Layout_Memo_color_Background, 3, 2);
  Var_Konsole_Layout_Memo_color_Background_Change3 := copy(Var_Konsole_Layout_Memo_color_Background, 5, 2);
  Var_Konsole_Layout_Memo_color_Background := '$' + Var_Konsole_Layout_Memo_color_Background_Change3 + Var_Konsole_Layout_Memo_color_Background_Change2 + Var_Konsole_Layout_Memo_color_Background_Change1;

end;

function TFormelsammlung.Get_Konsole_Layout_Memo_color_Background;
begin
  Konsole_Memo.color := (stringtocolor (Var_Konsole_Layout_Memo_color_Background));
end;



procedure TKonsole_Form.FormCreate(Sender: TObject);
begin
Formelsammlung := TFormelsammlung.Create;
end;

procedure TKonsole_Form.Konsole_ButtonClick(Sender: TObject);
begin
Formelsammlung.Set_Konsole_Layout_Memo_color_Background (Konsole_Edit.Text);
Formelsammlung.Get_Konsole_Layout_Memo_color_Background;
end;


procedure TKonsole_Form.FormDesrtoy(Sender: TObject);
begin
Formelsammlung.Free;
end;



end.
Wisst ihr was los is wenn nötig geb ich auch noch die fehlermeldung an

mkinzler 25. Okt 2006 18:47

Re: Problem beim Erstellen einer klasse
 
Zitat:

Wisst ihr was los is wenn nötig geb ich auch noch die fehlermeldung an
und am Besten noch die Zeile, in der die Exception auftritt

Axxus 26. Okt 2006 11:38

Re: Problem beim Erstellen einer klasse
 
Sorry das es erst jetzt kommt

Fehlermeldung:

In Project Matrix_Windows_controler.exe ist ein exeption der Klasse EAccessViolation mit der Meldung
'zugriffsverletzung bei Addresse 00438124 in modul Matrix_Windows_controler.exe lesen von Adresse 00000070' Aufgetreten

Zeile gibt er net an

Wisst ihr worans liegt???

Axxus

Jürgen Thomas 26. Okt 2006 13:19

Re: Problem beim Erstellen einer klasse
 
Hallo,
dafür gibt es den Debugger: Haltepunkt (Breakpoint) auf "verdächtige" Zeilen setzen und schrittweise durchgehen - dann wird es an einer bestimmten Zeile knallen, und dort ist das Problem.

Wenn Du keine Idee hast, wo das Problem sitzen könnte, dann setze den Haltepunkt möglichst früh.

AccessViolation deutet grundsätzlich darauf hin, dass Du ein Objekt ansprechen willst, das noch nicht erzeugt wurde.

Gruß Jürgen

KrasserChecker 26. Okt 2006 13:25

Re: Problem beim Erstellen einer klasse
 
Vielleicht solltest Du einfach mal versuchen der Variablen (die im übrigen "Feld" genannt wird...) "Konsole_Memo" aus der Klasse "TFormelsammlung" einen Wert zuzuweisen.

Sonst greifst Du nämlich in der Methode "Get_Konsole_Layout_Form_color_Background" ins Leere.

Etwa so:
Delphi-Quellcode:
procedure TKonsolen_Form.FormCreate(Sender: TObject);
begin
  Formelsammlung:= TFormelsammlung.Create;
  Formelsammlung.Konsole_Memo := Konsole_Memo;
end;

Axxus 26. Okt 2006 14:21

Re: Problem beim Erstellen einer klasse
 
Wieder was gelernt danke

Axxus


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:25 Uhr.
Seite 2 von 2     12   

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