AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Lazarus (IDE) Exception-Klasse >>External:SIGSEGV<< bei Timer
Thema durchsuchen
Ansicht
Themen-Optionen

Exception-Klasse >>External:SIGSEGV<< bei Timer

Ein Thema von heel213 · begonnen am 23. Jan 2017 · letzter Beitrag vom 24. Jan 2017
 
Benutzerbild von heel213
heel213

Registriert seit: 23. Jan 2017
Ort: Authority
10 Beiträge
 
#1

Exception-Klasse >>External:SIGSEGV<< bei Timer

  Alt 23. Jan 2017, 13:44
Moin,
ich will einen Timer in meinem "Programm" einfügen, bekomme nach dem Kompilieren allerdings immer eine Fehlermeldung, wenn das Programm starten will.
Ich bitte um Hilfe, vielen Dank.
An der fett markierten Stelle wird der Fehler angezeigt.



Delphi-Quellcode:
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  ExtCtrls;

type

  { TForm1 }

  TForm1 = class(TForm)
    Button1: TButton;
    Image1: TImage;
    Label1: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Label16: TLabel;
    Label17: TLabel;
    Label18: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    ScrollBar1: TScrollBar;
    ScrollBar2: TScrollBar;
    ScrollBar3: TScrollBar;
    ScrollBar4: TScrollBar;
    ScrollBar5: TScrollBar;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure ScrollBar1Change(Sender: TObject);

    procedure ScrollBar2Change(Sender: TObject);

    procedure ScrollBar3Change(Sender: TObject);

    procedure ScrollBar4Change(Sender: TObject);

    procedure ScrollBar5Change(Sender: TObject);

  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;
  timer1: ttimer;
  Einwohner : UInt64;
  Zusammenrechnung, i: Integer;
  Stein,Nahrung,Luxusgueter,Gold,Goldproduktion, Nahrungproduktion, Steinproduktion, Holzproduktion, Luxusgueterproduktion : real;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.ScrollBar1Change(Sender: TObject);
begin
   Label8.caption:=inttostr(Scrollbar1.position);
end;

procedure TForm1.ScrollBar2Change(Sender: TObject);
begin
    Label9.caption:=inttostr(scrollbar2.position);
end;

procedure TForm1.ScrollBar3Change(Sender: TObject);
begin
   label10.caption:=inttostr(scrollbar3.position);
end;


procedure TForm1.ScrollBar4Change(Sender: TObject);
begin
   label11.caption:=inttostr(scrollbar4.position);
end;

procedure TForm1.ScrollBar5Change(Sender: TObject);
begin
    label12.caption:=inttostr(scrollbar5.position);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Zusammenrechnung:=Scrollbar1.position+Scrollbar2.position+Scrollbar3.position+
  scrollbar4.position+scrollbar5.position;
   If Zusammenrechnung=100 then
  begin
    label6.Visible:=false;
    label7.visible:=false;
    Goldproduktion:=(scrollbar1.position/100)*Einwohner;
    Nahrungproduktion:=(scrollbar2.position/100)*Einwohner;
    Steinproduktion:=(scrollbar3.position/100)*Einwohner;
    Holzproduktion:=(scrollbar4.position/100)*Einwohner;
    Luxusgueterproduktion:=(scrollbar5.position/100)*Einwohner;
  end
  else
  begin
    if Zusammenrechnung<100 then
    begin
      label7.visible:=true;
      label6.visible:=false;
      end
    else
    begin
      label6.visible:=true;
      label7.visible:=false;
      end;
end;
  label18.caption:='Momentane Produktion: Stein='+floattostr(Steinproduktion)+'/s Luxusgüter='+floattostr(Luxusgueterproduktion)+'/s Nahrung='+floattostr(Nahrungproduktion)+'/s Gold='+floattostr(Goldproduktion)+'/s';
  repeat
      begin
      timer1.enabled:=true;
      Luxusgueter:=Luxusgueter+Luxusgueterproduktion;
      Stein:=Stein+Steinproduktion;
      Nahrung:=Nahrung+Nahrungproduktion;
      Gold:=Gold+Goldproduktion;
      i:=i+1;
      end;
  until i=100;

end;

procedure TForm1.FormCreate(Sender: TObject);
begin[B]
  timer1.Interval:=100;[/B]
  i:=1;
  label6.visible:=false;
  label7.visible:=false;
  Einwohner:=5000;
  end;
end.

end.

http://www.fotos-hochladen.net/uploa...c784gbp5lo.png
Der, der die Company zerstören wird aka der Heelischste von allen.

Geändert von Luckie (23. Jan 2017 um 18:03 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 05:04 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