Sayfayı Yazdır | Pencereyi Kapat

Fonksiyonlarım çağırmadan geliyor

Nereden Yazdırıldığı: Clomosy | Forum
Kategori: Genel Programlama
Forum Adı: Genel İşlemler
Forum Tanımlaması: TRObject dili ile programlama yaparken karşılaşılan genel işlemler
URL: https://forum.clomosy.com.tr/forum_posts.asp?TID=1176
Tarih: 12 Ağustos 2025 Saat 16:29
Program Versiyonu: Web Wiz Forums 12.07 - https://www.webwizforums.com


Konu: Fonksiyonlarım çağırmadan geliyor
Mesajı Yazan: Ahmet_27
Konu: Fonksiyonlarım çağırmadan geliyor
Mesaj Tarihi: 12 Ağustos 2025 Saat 09:33
Butona ekrana showmessage ile mesaj yazdıran event atadım. Daha butonlarıma tıklamadan sayfa açıldığı gibi ikisine de tıklanmış gibi karşıma mesajlar çıkıyor. Daha sonra ben butona bastığımda hata veriyor.

/*BasisForm*/
Dönüşüm
TclForm
Syntax error

Source position 1.2

/*BasisForm*/
Kelebek
TclForm
Unkown identifier or variable is not declared 'Kelebek'
source position 1.2

kelebek değişken bile değil yani normalde. hem basmadan ilk başta ekrana geliyor ben basınca hata veriyor. hiç bir şey anlamadım.

void AnlaminiGosterTransformation {
  ShowMessage('Dönüşüm');
}

void AnlaminiGosterButterfly {
  ShowMessage('Kelebek');
}



Kelime2Label = Metin1_Form.AddNewProLabel(Satir1Panel, 'Kelime2Label', 'transformation');
  Kelime2Label.Align = alLeft;
  Kelime2Label.Height = 20;
  Kelime2Label.Width = 200;
  Kelime2Label.Margins.Top = 5;
  Kelime2Label.clProSettings.FontSize = 30;
  Kelime2Label.clProSettings.WordWrap = True;
  Kelime2Label.clProSettings.FontColor = clAlphaColor.clHexToColor('#33a30a');
  Kelime2Label.SetclProSettings(Kelime2Label.clProSettings);

  Metin1_Form.AddNewEvent(Kelime2Label,tbeOnClick, AnlaminiGosterTransformation);

  Kelime4Label = Metin1_Form.AddNewProLabel(Satir2Panel, 'Kelime4Label', 'butterfly');
  Kelime4Label.Align = alLeft;
  Kelime4Label.Height = 20;
  Kelime4Label.Width = 120;
  Kelime4Label.Margins.Top = 5;
  Kelime4Label.clProSettings.FontSize = 30;
  Kelime4Label.clProSettings.WordWrap = True;
  Kelime4Label.clProSettings.FontColor = clAlphaColor.clHexToColor('#33a30a');
  Kelime4Label.SetclProSettings(Kelime2Label.clProSettings);

  Metin1_Form.AddNewEvent(Kelime4Label,tbeOnClick, AnlaminiGosterButterfly);



Cevaplar:
Mesajı Yazan: Emr.Erkmn
Mesaj Tarihi: 12 Ağustos 2025 Saat 09:41
Merhaba Ahmet, 
Burada ki kodda değişkenler nedir? 
Mesela Kelebek nedir?
Değişken tanımlamadan önce kullandığımız 'var' yok,
Değişkenleri tanımlarken sınıfları ya da türleri belli değil hangisi nedir?
Kodu düzenleyip tekrar atar mısın?
İyi çalışmalar. 


Mesajı Yazan: Ahmet_27
Mesaj Tarihi: 12 Ağustos 2025 Saat 09:49
Var
 Metin1_Form : TclForm;
 Kelime1Label, Kelime2Label, Kelime3Label, Kelime4Label, Kelime5Label, Kelime6Label : TClProLabel;
 Kelime7Label, Kelime8Label, Kelime9Label, Kelime10Label, Kelime11Label, Kelime12Label : TClProLabel;
 Satir1Panel, Satir2Panel, Satir3Panel, Satir4Panel : TclProPanel;
 AnlamLabel : TClProLabel;
 
 anlami : String;
 
 Kontrol : Integer;


void AnlaminiGosterTransformation {
  ShowMessage('Dönüşüm');
}

void AnlaminiGosterButterfly {
  ShowMessage('Kelebek');
}


void AnlaminiGosterTransformation {
  ShowMessage('Dönüşüm');
}

void AnlaminiGosterButterfly {
  ShowMessage('Kelebek');
}



Kelime2Label = Metin1_Form.AddNewProLabel(Satir1Panel, 'Kelime2Label', 'transformation');
  Kelime2Label.Align = alLeft;
  Kelime2Label.Height = 20;
  Kelime2Label.Width = 200;
  Kelime2Label.Margins.Top = 5;
  Kelime2Label.clProSettings.FontSize = 30;
  Kelime2Label.clProSettings.WordWrap = True;
  Kelime2Label.clProSettings.FontColor = clAlphaColor.clHexToColor('#33a30a');
  Kelime2Label.SetclProSettings(Kelime2Label.clProSettings);

  Metin1_Form.AddNewEvent(Kelime2Label,tbeOnClick, AnlaminiGosterTransformation);

  Kelime4Label = Metin1_Form.AddNewProLabel(Satir2Panel, 'Kelime4Label', 'butterfly');
  Kelime4Label.Align = alLeft;
  Kelime4Label.Height = 20;
  Kelime4Label.Width = 120;
  Kelime4Label.Margins.Top = 5;
  Kelime4Label.clProSettings.FontSize = 30;
  Kelime4Label.clProSettings.WordWrap = True;
  Kelime4Label.clProSettings.FontColor = clAlphaColor.clHexToColor('#33a30a');
  Kelime4Label.SetclProSettings(Kelime2Label.clProSettings);

  Metin1_Form.AddNewEvent(Kelime4Label,tbeOnClick, AnlaminiGosterButterfly);





Bu koddaki değişkenler yukarıdaki gibi.
Kelebek diye bir değişkenim yok. O bir showmessage ile ekrana yazılan bir string.
'var' var atmamıştım değişkenleri.
sınıflar türler yukarıdaki gibi.
sağ olun hocam.


dediğim gibi sorunum şu: Butona ekrana showmessage ile mesaj yazdıran event atadım. Daha butonlarıma tıklamadan sayfa açıldığı gibi ikisine de tıklanmış gibi karşıma mesajlar çıkıyor. Daha sonra ben butona bastığımda hata veriyor.

Butona ekrana showmessage ile mesaj yazdıran event atadım. Daha butonlarıma tıklamadan sayfa açıldığı gibi ikisine de tıklanmış gibi karşıma mesajlar çıkıyor. Daha sonra ben butona bastığımda hata veriyor.

/*BasisForm*/
Dönüşüm
TclForm
Syntax error

Source position 1.2

/*BasisForm*/
Kelebek
TclForm
Unkown identifier or variable is not declared 'Kelebek'
source position 1.2


Mesajı Yazan: Emr.Erkmn
Mesaj Tarihi: 12 Ağustos 2025 Saat 11:00
Emirhan kodu düzenledim, aşağıda düzenli hali yer almakta;
 var
 Metin1_Form : TclForm;
 Kelime1Label, Kelime2Label, Kelime3Label, Kelime4Label, Kelime5Label, Kelime6Label : TClProLabel;
 Kelime7Label, Kelime8Label, Kelime9Label, Kelime10Label, Kelime11Label, Kelime12Label : TClProLabel;
 Satir1Panel, Satir2Panel, Satir3Panel, Satir4Panel : TclProPanel;
 AnlamLabel : TClProLabel;
 anlami : String;
 Kontrol : Integer;

void AnlaminiGosterTransformation 
{
  ShowMessage('Dönüşüm');
}

void AnlaminiGosterButterfly 
{
 ShowMessage('Kelebek');
}
{
  Metin1_Form=TclForm.Create(self);

  Kelime2Label = Metin1_Form.AddNewProLabel(Metin1_Form, 'Kelime2Label', 'transformation');
  Kelime2Label.Align = alLeft;
  Kelime2Label.Height = 20;
  Kelime2Label.Width = 200;
  Kelime2Label.Margins.Top = 5;
  Kelime2Label.clProSettings.FontSize = 30;
  Kelime2Label.clProSettings.WordWrap = True;
  Kelime2Label.clProSettings.FontColor = clAlphaColor.clHexToColor('#33a30a');
  Kelime2Label.SetclProSettings(Kelime2Label.clProSettings);
  Metin1_Form.AddNewEvent(Kelime2Label,tbeOnClick, 'AnlaminiGosterTransformation');

  Kelime4Label = Metin1_Form.AddNewProLabel(Metin1_Form, 'Kelime4Label', 'butterfly');
  Kelime4Label.Align = alRight;
  Kelime4Label.Height = 20;
  Kelime4Label.Width = 120;
  Kelime4Label.Margins.Top = 5;
  Kelime4Label.clProSettings.FontSize = 30;
  Kelime4Label.clProSettings.WordWrap = True;
  Kelime4Label.clProSettings.FontColor = clAlphaColor.clHexToColor('#33a30a');
  Kelime4Label.SetclProSettings(Kelime2Label.clProSettings);
  Metin1_Form.AddNewEvent(Kelime4Label,tbeOnClick, 'AnlaminiGosterButterfly');
  
  Metin1_Form.Run;
  }



Sayfayı Yazdır | Pencereyi Kapat

Forum Software by Web Wiz Forums® version 12.07 - https://www.webwizforums.com
Copyright ©2001-2024 Web Wiz Ltd. - https://www.webwiz.net