Q-matik yazılımı
Q-matik yazılımı
merhabalar herkese,ben delphiyi yeni yeni öğrenmeye çalışıyorum,aşağıdaki kodları delphide(7.0) yazdım ama çalışmadı,sorunuda bulamadım,yardımcı olurmusunuz?
-----------------------------------------------------------------
var
numara:Integer=0;
procedure TForm1.FormCreate(Sender: TObject);
begin
Panel2.Caption:='0';
Panel3.Caption:='';
Timer1.Enabled:=false;
Timer2.Enabled:=false;
Timer3.Enabled:=false;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
{$j+}
const
yon:Boolean=false;
begin
if yon=false Then
begin
BitBtn1.Caption:='';
yon:=true;
end
else
begin
BitBtn1.Caption:='Masa1';
yon:=false;
end
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
Timer1.Enabled:=true;
Timer2.Enabled:=false;
Timer3.Enabled:=false;
inc(numara);
Panel2.Caption:=IntToStr(numara);
Panel3.Caption:='Masa1';
BitBtn2.Caption:='Masa2';
BitBtn3.Caption:='Masa3';
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
Timer1.Enabled:=false;
Timer2.Enabled:=true;
Timer3.Enabled:=false;
inc(numara);
Panel2.Caption:=IntToStr(numara);
Panel3.Caption:='Masa2';
BitBtn1.Caption:='Masa1';
BitBtn3.Caption:='Masa3';
end;
procedure TForm1.BitBtn3Click(Sender: TObject);
begin
Timer1.Enabled:=false;
Timer2.Enabled:=false;
Timer3.Enabled:=true;
inc(numara);
Panel2.Caption:=IntToStr(numara);
Panel3.Caption:='Masa3';
BitBtn2.Caption:='Masa2';
BitBtn1.Caption:='Masa1';
end;
procedure TForm1.Timer2Timer(Sender: TObject);
{$j+}
const
yon:Boolean=false;
begin
if yon=false Then
begin
BitBtn2.Caption:='';
yon:=true;
end
else
begin
BitBtn2.Caption:='Masa2';
yon:=false;
end
end;
procedure TForm1.Timer3Timer(Sender: TObject);
{$j+}
const
yon:Boolean=false;
begin
if yon=false Then
begin
BitBtn3.Caption:='';
yon:=true;
end
else
begin
BitBtn3.Caption:='Masa3';
yon:=false;
end
end;
-----------------------------------------------------------------
var
numara:Integer=0;
procedure TForm1.FormCreate(Sender: TObject);
begin
Panel2.Caption:='0';
Panel3.Caption:='';
Timer1.Enabled:=false;
Timer2.Enabled:=false;
Timer3.Enabled:=false;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
{$j+}
const
yon:Boolean=false;
begin
if yon=false Then
begin
BitBtn1.Caption:='';
yon:=true;
end
else
begin
BitBtn1.Caption:='Masa1';
yon:=false;
end
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
Timer1.Enabled:=true;
Timer2.Enabled:=false;
Timer3.Enabled:=false;
inc(numara);
Panel2.Caption:=IntToStr(numara);
Panel3.Caption:='Masa1';
BitBtn2.Caption:='Masa2';
BitBtn3.Caption:='Masa3';
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
Timer1.Enabled:=false;
Timer2.Enabled:=true;
Timer3.Enabled:=false;
inc(numara);
Panel2.Caption:=IntToStr(numara);
Panel3.Caption:='Masa2';
BitBtn1.Caption:='Masa1';
BitBtn3.Caption:='Masa3';
end;
procedure TForm1.BitBtn3Click(Sender: TObject);
begin
Timer1.Enabled:=false;
Timer2.Enabled:=false;
Timer3.Enabled:=true;
inc(numara);
Panel2.Caption:=IntToStr(numara);
Panel3.Caption:='Masa3';
BitBtn2.Caption:='Masa2';
BitBtn1.Caption:='Masa1';
end;
procedure TForm1.Timer2Timer(Sender: TObject);
{$j+}
const
yon:Boolean=false;
begin
if yon=false Then
begin
BitBtn2.Caption:='';
yon:=true;
end
else
begin
BitBtn2.Caption:='Masa2';
yon:=false;
end
end;
procedure TForm1.Timer3Timer(Sender: TObject);
{$j+}
const
yon:Boolean=false;
begin
if yon=false Then
begin
BitBtn3.Caption:='';
yon:=true;
end
else
begin
BitBtn3.Caption:='Masa3';
yon:=false;
end
end;
Haklı olarak "çalışmadı" "hata verdi" gibi belirsiz sorular kolay kolay çözüm bulamayacaktır ya da çok zaman alacaktır. Doğrusu ne beklerken ne oldudameon yazdı:sorun nedir , benim delphi 6.0'da çalıştı.
Ayrıca çalışmadı diyorsun , nasıl bir hata veriyor ya da nasıl çalışmasını istiyorsun ?




Bilgiyi paylaşarak artıralım! Hayatı kolaylaştıralım!!
yeterince açıklayıcı olmamış kusura bakmayın
bu yazdığım kod benim çalıştığım kitaptaki bir örnekte yazıyor.tabi önce form kısmı oluşturuluyor,formun kaynak kodu,sanırım şu(dediğiniz gibi alt+f12 yaptım)
-----------------------------
object Form1: TForm1
Left = 172
Top = 114
Width = 696
Height = 480
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 264
Top = 368
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 0
end
object Button2: TButton
Left = 368
Top = 368
Width = 75
Height = 25
Caption = 'Button2'
TabOrder = 1
end
object Button3: TButton
Left = 464
Top = 368
Width = 75
Height = 25
Caption = 'Button3'
TabOrder = 2
end
object Panel1: TPanel
Left = 320
Top = 136
Width = 185
Height = 41
Caption = 'Panel1'
TabOrder = 3
end
object Panel2: TPanel
Left = 320
Top = 176
Width = 185
Height = 41
Caption = 'Panel2'
TabOrder = 4
end
object Timer1: TTimer
Left = 72
Top = 80
end
object Timer2: TTimer
Left = 112
Top = 80
end
object Timer3: TTimer
Left = 160
Top = 80
end
end
ben örnekte dediği gibi formu oluşturdum,kodlarıda unite girdim,run dedim
mesela şu satırda hata veriyor;
procedure TForm1.FormCreate(Sender: TObject);
ne alaka anlayamadım
çok yeniyim,sanırım derdimi bile anlatamıyorum,neyse kurcalayarak öğrenecez artık
bu yazdığım kod benim çalıştığım kitaptaki bir örnekte yazıyor.tabi önce form kısmı oluşturuluyor,formun kaynak kodu,sanırım şu(dediğiniz gibi alt+f12 yaptım)
-----------------------------
object Form1: TForm1
Left = 172
Top = 114
Width = 696
Height = 480
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 264
Top = 368
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 0
end
object Button2: TButton
Left = 368
Top = 368
Width = 75
Height = 25
Caption = 'Button2'
TabOrder = 1
end
object Button3: TButton
Left = 464
Top = 368
Width = 75
Height = 25
Caption = 'Button3'
TabOrder = 2
end
object Panel1: TPanel
Left = 320
Top = 136
Width = 185
Height = 41
Caption = 'Panel1'
TabOrder = 3
end
object Panel2: TPanel
Left = 320
Top = 176
Width = 185
Height = 41
Caption = 'Panel2'
TabOrder = 4
end
object Timer1: TTimer
Left = 72
Top = 80
end
object Timer2: TTimer
Left = 112
Top = 80
end
object Timer3: TTimer
Left = 160
Top = 80
end
end
ben örnekte dediği gibi formu oluşturdum,kodlarıda unite girdim,run dedim
mesela şu satırda hata veriyor;
procedure TForm1.FormCreate(Sender: TObject);
ne alaka anlayamadım
çok yeniyim,sanırım derdimi bile anlatamıyorum,neyse kurcalayarak öğrenecez artık

Sanırım kodları doğrudan yazmışsınız. Halbuki FormCreate deki gibi form a tıklayıp Object Inspector dan events kısmına geçip oradaki OnCreate kısmına yazmalısınız. Ya da kısayolu forma çift klik yapın. Aynı şekilde Timer lara da çift klik yapıp OnTimer larına ilgili kodları yazınız..
Bilgiyi paylaşarak artıralım! Hayatı kolaylaştıralım!!
dediğiniz gibi tek tek yapmaya başladım
bu seferde formcreate ve timer1 aşamasından sonra bitbtn1 e tıkladığımda onclick ini yani şu hata msjını veriyo
could not find source location to add method bitbtn1."END." or INITILATION not found on unit form
bulunamadı fln diyor ama hepsini koydum formun üzerine,neden böyle bi hata verirki?
bu seferde formcreate ve timer1 aşamasından sonra bitbtn1 e tıkladığımda onclick ini yani şu hata msjını veriyo
could not find source location to add method bitbtn1."END." or INITILATION not found on unit form
bulunamadı fln diyor ama hepsini koydum formun üzerine,neden böyle bi hata verirki?
- kadirkurtoglu
- Üye
- Mesajlar: 748
- Kayıt: 22 May 2005 01:20
- Konum: Uzakta Görünen Tepeden...
Kardeş , benim unit1.pas dosyam şu şekilde ve çalışıyor , seninki ile bir karşılaştır istersen.
Kod: Tümünü seç
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Buttons;
type
TForm1 = class(TForm)
Panel2: TPanel;
Panel3: TPanel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
Timer1: TTimer;
Timer2: TTimer;
Timer3: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
procedure Timer3Timer(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
numara:Integer=0;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Panel2.Caption:='0';
Panel3.Caption:='';
Timer1.Enabled:=false;
Timer2.Enabled:=false;
Timer3.Enabled:=false;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
{$j+}
const
yon:Boolean=false;
begin
if yon=false Then
begin
BitBtn1.Caption:='';
yon:=true;
end
else
begin
BitBtn1.Caption:='Masa1';
yon:=false;
end
end;
procedure TForm1.Timer2Timer(Sender: TObject);
{$j+}
const
yon:Boolean=false;
begin
if yon=false Then
begin
BitBtn2.Caption:='';
yon:=true;
end
else
begin
BitBtn2.Caption:='Masa2';
yon:=false;
end
end;
procedure TForm1.Timer3Timer(Sender: TObject);
{$j+}
const
yon:Boolean=false;
begin
if yon=false Then
begin
BitBtn3.Caption:='';
yon:=true;
end
else
begin
BitBtn3.Caption:='Masa3';
yon:=false;
end
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
Timer1.Enabled:=true;
Timer2.Enabled:=false;
Timer3.Enabled:=false;
inc(numara);
Panel2.Caption:=IntToStr(numara);
Panel3.Caption:='Masa1';
BitBtn2.Caption:='Masa2';
BitBtn3.Caption:='Masa3';
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
Timer1.Enabled:=false;
Timer2.Enabled:=true;
Timer3.Enabled:=false;
inc(numara);
Panel2.Caption:=IntToStr(numara);
Panel3.Caption:='Masa2';
BitBtn1.Caption:='Masa1';
BitBtn3.Caption:='Masa3';
end;
procedure TForm1.BitBtn3Click(Sender: TObject);
begin
Timer1.Enabled:=false;
Timer2.Enabled:=false;
Timer3.Enabled:=true;
inc(numara);
Panel2.Caption:=IntToStr(numara);
Panel3.Caption:='Masa3';
BitBtn2.Caption:='Masa2';
BitBtn1.Caption:='Masa1';
end;
end.