AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein Felder einer Klasse werden nicht erkannt
Thema durchsuchen
Ansicht
Themen-Optionen

Felder einer Klasse werden nicht erkannt

Ein Thema von Ykcim · begonnen am 27. Okt 2012 · letzter Beitrag vom 27. Okt 2012
 
Ykcim

Registriert seit: 29. Dez 2006
Ort: NRW
856 Beiträge
 
Delphi 12 Athens
 
#1

Felder einer Klasse werden nicht erkannt

  Alt 27. Okt 2012, 12:15
Hallo Zusammen,

ich mache gerade meine ersten Schritte in der OOP. Das heißt, dass ich erst seit ein paar Tagen mit Klassen arbeite. Eigentlich hat es nach guter Anleitung auch geklappt, aber jetzt stehe ich gerade auf dem Schlauch:

Ich habe eine Klasse definiert und möchte im constructor create Klassenvariablen einen Wert zuweisen. Aber aus irgendeinem Grund knallt es.

Ich habe hier meinen Code:
Delphi-Quellcode:
TFA_Info = class
      strict protected
         FWAAUNR: string;
         FWAAUPO: string;
         FWATENR: string;
         FTEBEZ1: string;
         FLagerBest: string;
         FSicherBest: string;
      public
         constructor create(Grid: TAdvStringGrid; SpalteWAAUNR, SpalteWAAUPO,
                            SpalteWATENR, SpalteTEBEZ1: integer);
         function GetLagerBest: string;
         function GetSicherBest: string;
         function GetWAAUNR: string;
         function GetWAAUPO: string;
         function GetWATENR: string;
         function GetTEBEZ1: string;
         property LagerBestand: string read GetLagerBest;
         property SicherheitsBestand: string read GetSicherBest;
         property WAAUNR: string read GetWAAUNR;
         property WAAUPO: string read GetWAAUPO;
         property WATENR: string read GetWATENR;
         property TEBEZ1: string read GetTEBEZ1;
   end;

Und hier der Implementationsteil

Delphi-Quellcode:
constructor TFA_Info.create(Grid: TAdvStringGrid; SpalteWAAUNR, SpalteWAAUPO,
                            SpalteWATENR, SpalteTEBEZ1: integer);
begin
   FWAAUNR:=Grid.Cells[SpalteWAAUNR,Grid.Row];
   FWAAUPO:=Grid.Cells[SpalteWAAUPO,Grid.Row];
   FWATENR:=Grid.Cells[SpalteWATENR,Grid.Row];
   FTEBEZ1:=Grid.Cells[SpalteTEBEZ1,Grid.Row];

   Main.MySelectQuery.SQL.Clear;
   Main.MySelectQuery.SQL.Add('select sum(LSLGBE) from oms14 ');
   Main.MySelectQuery.SQL.Add('where WATENR= :WATENR ');
   Main.MySelectQuery.SQL.Add('group by WATENR');
   Main.MySelectQuery.ParamByName('WATENR').AsString:=FWAAUNR;
   Main.MySelectQuery.Open;
   FLagerBest:=Main.MySelectQuery.Fields.Fields[0].Text;
end;

function TFA_Info.GetLagerBest;
begin
   Result:=FLagerBest;
end;

function TFA_Info.GetSicherBest;
begin
   Result:=FSicherBest;
end;

function TFA_Info.GetWAAUNR;
begin
   Result:=FWAAUNR;
end;

function TFA_Info.GetWAAUPO;
begin
   Result:=FWAAUPO;
end;

function TFA_Info.GetWATENR;
begin
   Result:=FWATENR;
end;

function TFA_Info.GetTEBEZ1;
begin
   Result:=FTEBEZ1;
end;

Hat jemand eine Idee, was ich da falsch mache?

Vielen Dank
Ykcim
Patrick

Geändert von Ykcim (27. Okt 2012 um 12:26 Uhr)
  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 08:46 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-2025 by Thomas Breitkreuz