AGB  ·  Datenschutz  ·  Impressum  







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

Schleife / Ungültige Zeigeroperation!?

Ein Thema von morri · begonnen am 28. Jun 2006 · letzter Beitrag vom 28. Jun 2006
Antwort Antwort
morri

Registriert seit: 6. Jun 2006
Ort: Wuppertal
106 Beiträge
 
Delphi 7 Professional
 
#1

Re: Schleife / Ungültige Zeigeroperation!?

  Alt 28. Jun 2006, 11:42
Um den Code noch zu erweitern:

Delphi-Quellcode:
procedure Tgrafiken.Button1Click(Sender: TObject);
begin
 jahr:='2006';
 jahrund1:='2007';
 apg;
end;


procedure tgrafiken.apg;
var he,he2:integer;
    monat: array of array of integer;
    i,z:integer;

BEGIN

  he:=1;
  zqapg.SQL.Text:='select * from fehlerorte';
  zqapg.Open;
  setlength(monat,12,zqapg.RecordCount);
  z:=zqapg.RecordCount;
  repeat
   chart3.AddSeries(tbarseries.Create(self));
   chart3.Series[he].Title:=zqapg.FieldValues['bez'];
   chart3.Series[he].SeriesColor:=farben[he];
   zqapg.Next;
   he:=he+1;
  until zqapg.Eof;
  he2:=1;
 { repeat
  zqapg.SQL.Text:='select * from listeorte where `orte`='''+inttostr(he2)+'''';
  zqapg.Open;
  chart3.Series[he2].AddXY(1,zqapg.RecordCount,'Januar',farben[he2]);
  he2:=he2+1;
  until he2=he;           }


  FOR i:=1 TO 12 DO
   begin
    he2:=1;
    if i<9 then
     begin
      repeat
      zqapg.SQL.Text:='select * from liste INNER JOIN listeorte on reklamnr=liste where (`orte`='''+inttostr(he2)+''') AND (`reklamdatum`>='''+jahr+'-0'+inttostr(i)+'-01'') AND (`reklamdatum`<'''+jahr+'-0'+inttostr(i+1)+'-01'')';
      zqapg.Open;
      monat[i-1,he2]:=zqapg.RecordCount;
      he2:=he2+1;
      until he2=he;
     end;
    if i=9 then
     begin
      repeat
       zqapg.SQL.Text:='select * from liste INNER JOIN listeorte on reklamnr=liste where `orte`='''+inttostr(he2)+''' AND (`reklamdatum`>='''+jahr+'-0'+inttostr(i)+'-01'') AND (`reklamdatum`<'''+jahr+'-'+inttostr(i+1)+'-01'')';
       zqapg.Open;
       monat[i-1,he2]:=zqapg.RecordCount;
       he2:=he2+1;
      until he2=he;
     end;
    if (i=10) or (i=11) then
     begin
      repeat
       zqapg.SQL.Text:='select * from liste INNER JOIN listeorte on reklamnr=liste where `orte`='''+inttostr(he2)+''' AND (`reklamdatum`>='''+jahr+'-'+inttostr(i)+'-01'') AND (`reklamdatum`<'''+jahr+'-'+inttostr(i+1)+'-01'')';
       zqapg.Open;
       monat[i-1,he2]:=zqapg.RecordCount;
       he2:=he2+1;
      until he2=he;
     end;
    if i=12 then
     begin
      repeat
       zqapg.SQL.Text:='select * from liste INNER JOIN listeorte on reklamnr=liste where `orte`='''+inttostr(he2)+''' AND (`reklamdatum`>='''+jahr+'-'+inttostr(i)+'-01'') AND (`reklamdatum`<'''+jahrund1+'-01-01'')';
       zqapg.Open;
       monat[i-1,he2]:=zqapg.RecordCount;
       he2:=he2+1;
      until he2=he;
     end;
   end;

end;
Nach dem Fehler Springt er ans ende des Buttonclick-ereignisses.
  Mit Zitat antworten Zitat
Antwort Antwort


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 16:40 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