Sayfayı Yazdır | Pencereyi Kapat

spor uygulamasında hata

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=1147
Tarih: 30 Temmuz 2025 Saat 06:06
Program Versiyonu: Web Wiz Forums 12.07 - https://www.webwizforums.com


Konu: spor uygulamasında hata
Mesajı Yazan: kayra12
Konu: spor uygulamasında hata
Mesaj Tarihi: 29 Temmuz 2025 Saat 09:40

var
  Formum: TCLForm;
  AdGiris, BoyGiris, KiloGiris: TCLEdit;
  SonucYazi, OneriYazi, HareketBilgiYazi: TCLLabel;
  Hesaplabutton, Squatbutton, Plankbutton, Ziplabutton, Mekikbutton, Dagcibutton,resimlinkbutton : TCLButton;
  AnaAlan, BilgiAlan, buttonAlan, SonucAlani, OneriAlani, HareketAlani, BolgeAlan, TakvimAlani: TCLPanel;
  HareketResim: TCLImage;
  Kolbutton, Sirtbutton, Bacakbutton,  Barbell_BicepsCurlbutton, Dumbell_Hammerbutton, Incline_Dumbell_Pressbutton,  AlternateDumbellCurlbutton,  Dumbell_Concentrationbutton, Hyperextensionbutton, Latpull_downbutton, Barfiksbutton, Bentoverowbutton, Barbell_deadliftbutton, HackSquatbutton, Standing_LegCurlbutton, LyingLegbutton,  LegExtensionbutton : TCLButton;
  KolResim, SirtResim, BacakResim: TCLImage;
  TakvimEtiketi: TCLLabel;
  ad: String;
  boy, kilo, vki: Float;
  durum, secilenBolge: String;
  bugunTarihi: String;

void HesaplabuttonTikla;
{
  if ((AdGiris.Text == '') || (BoyGiris.Text == '') || (KiloGiris.Text == ''))
  {
    ShowMessage('Lütfen tüm alanlari doldurunuz.');
  }
  else
  {
    ad = AdGiris.Text;
    boy = StrToFloat(BoyGiris.Text) / 100;
    kilo = StrToFloat(KiloGiris.Text);
    vki = kilo / (boy * boy);
    vki = Round(vki * 10) / 10;

    if (vki < 18.5)
      durum = 'Zayif - Direnç antrenmanlari yapabilirsiniz.';
    else if (vki < 25)
      durum = 'Normal - Haftada 3-4 gün kardiyo ve güç antrenmani önerilir.';
    else if (vki < 30)
      durum = 'Fazla kilolu - Düzenli yürüyüş ve hafif kardiyo yapmalisiniz.';
    else
      durum = 'Obez - Uzman kontrolünde düşük etkili egzersiz yapiniz.';

    SonucYazi.Text = 'Merhaba ' + ad + ', VKİ: ' + FloatToStr(vki);
    OneriYazi.Text = durum;
    HareketBilgiYazi.Text = '';

    bugunTarihi = DateToStr(Date());
    TakvimEtiketi.Text = 'Bugünkü kayit: ' + bugunTarihi + ' | VKİ: ' + FloatToStr(vki);
  }
}

void SquatbuttonTikla;
{
  HareketBilgiYazi.Text = 'Squat:\nAyaklar omuz hizasında açık, dizleri bükerek çömel. 3 set, 15 tekrar.';
  Formum.setImage(HareketResim, ' https://r.resimlink.com/6mVeGvN.png" rel="nofollow - https://r.resimlink.com/6mVeGvN.png ');
}

void PlankbuttonTikla;
{
  HareketBilgiYazi.Text = 'Plank:\nDirsekler ve ayak parmakları üzerinde dur, vücut düz dursun. 3 set, 30 saniye.';
  Formum.setImage(HareketResim, ' https://r.resimlink.com/K9HqRPEpJgUT.png" rel="nofollow - https://r.resimlink.com/K9HqRPEpJgUT.png ');
}

void ZiplabuttonTikla;
{
  HareketBilgiYazi.Text = 'Ziplamali Açma:\nAyaklar ve kollar açılıp kapanır. Kardiyo için idealdir. 3 set, 20 tekrar.';
  Formum.setImage(HareketResim, ' https://r.resimlink.com/PwpBcnXYEQS.png" rel="nofollow - https://r.resimlink.com/PwpBcnXYEQS.png ');
}

void MekikbuttonTikla;
{
  HareketBilgiYazi.Text = 'Mekik:\nSırt üstü yat, dizler bükülü, gövdeni kaldır. 3 set, 20 tekrar.';
  Formum.setImage(HareketResim, ' https://r.resimlink.com/OH0oJAIpT.png" rel="nofollow - https://r.resimlink.com/OH0oJAIpT.png ');
}

void DagcibuttonTikla;
{
  HareketBilgiYazi.Text = 'Dağci:\nŞınav pozisyonunda dizleri sırayla çek. 3 set, 30 tekrar.';
  Formum.setImage(HareketResim, ' https://r.resimlink.com/7NRTpK.png" rel="nofollow - https://r.resimlink.com/7NRTpK.png ');
}

void resimlinkbutton;
{
  resimlinkbutton = Formum.AddNewButton(AnaAlan, 'buttonAlan');
  resimlinkbutton.Align = alTop;
  resimlinkbutton.Height = 70;

}


void KolbuttonTikla;
{
  secilenBolge = 'Kol';
  Barbell_BicepsCurl_.Visible = False;
  Dumbell_Hammer_Curl.Visible = True;
  Incline_Dumbell_Press.Visible = False;
  AlternateDumbellCurl.Visible = True;
  Dumbell_Concentration_Curl.Visible = True;
}

void SirtbuttonTikla;
{
  secilenBolge = 'Sirt';
  Hyperextension_.Visible = False;
  Latpull_down_.Visible = True;
  Barfiks_.Visible = True;
  Bentoverow_.Visible = False;
  Barbell_deadlift_.Visible = True;

void BacakbuttonTikla;
{
  secilenBolge = 'bacak ';
  HackSquat_.Visible = True;
  LegPress_.Visible = False;
  Standing_LegCurl.Visible = True;
  LyingLeg_Curl.Visible = False;
  LegExtension_.Visible = False;
}


{
  Formum = TCLForm.Create(Self);

  AnaAlan = Formum.AddNewPanel(Formum, 'AnaAlan');
  AnaAlan.Align = alClient;
  AnaAlan.Margins.Top = 10;
  AnaAlan.Margins.Bottom = 10;
  AnaAlan.Margins.Left = 10;
  AnaAlan.Margins.Right = 10;


  BilgiAlan = Formum.AddNewPanel(AnaAlan, 'BilgiAlan');
  BilgiAlan.Align = alTop;
  BilgiAlan.Height = 120;


  AdGiris = Formum.AddNewEdit(BilgiAlan, 'AdGiris', 'Adıniz...');
  AdGiris.Align = alTop;
  AdGiris.Height = 30;


  BoyGiris = Formum.AddNewEdit(BilgiAlan, 'BoyGiris', 'Boy (cm)...');
  BoyGiris.Align = alTop;
  BoyGiris.clTypeOfField = taFloat;
  BoyGiris.Height = 30;


  KiloGiris = Formum.AddNewEdit(BilgiAlan, 'KiloGiris', 'Kilo (kg)...');
  KiloGiris.Align = alTop;
  KiloGiris.clTypeOfField = taFloat;
  KiloGiris.Height = 30;


  buttonAlan = Formum.AddNewPanel(AnaAlan, 'buttonAlan');
  buttonAlan.Align = alTop;
  buttonAlan.Height = 50;


  Hesaplabutton = Formum.AddNewButton(DugmeAlan, 'Hesaplabutton', 'VKİ Hesapla');
  Hesaplabutton.Align = alCenter;
  Hesaplabutton.Width = 140;
  Formum.AddNewEvent(HesaplaDugme, tbeOnClick, 'HesaplabuttonTikla');


  SonucAlani = Formum.AddNewPanel(AnaAlan, 'SonucAlani');
  SonucAlani.Align = alTop;
  SonucAlani.Height = 60;


  SonucYazi = Formum.AddNewLabel(SonucAlani, 'SonucYazi', '');
  SonucYazi.Align = alClient;
  SonucYazi.TextSettings.Font.Size = 16;


  OneriAlani = Formum.AddNewPanel(AnaAlan, 'OneriAlani');
  OneriAlani.Align = alTop;
  OneriAlani.Height = 70;


  OneriYazi = Formum.AddNewLabel(OneriAlani, 'OneriYazi', '');
  OneriYazi.Align = alClient;
  OneriYazi.WordWrap = True;
  OneriYazi.TextSettings.Font.Size = 14;


  TakvimAlani = Formum.AddNewPanel(AnaAlan, 'TakvimAlani');
  TakvimAlani.Align = alTop;
  TakvimAlani.Height = 50;


  TakvimEtiketi = Formum.AddNewLabel(TakvimAlani, 'TakvimEtiketi', 'Bugünkü kayıt: -');
  TakvimEtiketi.Align = alClient;
  TakvimEtiketi.TextSettings.Font.Size = 12;
  TakvimEtiketi.TextSettings.Font.Style = [fsBold];


  BolgeAlan = Formum.AddNewPanel(AnaAlan, 'BolgeAlan');
  BolgeAlan.Align = alTop;
  BolgeAlan.Height = 100;
  BolgeAlan.Margins.Bottom = 10;


  Kolbutton= Formum.AddNewButton(BolgeAlan, 'Kolbutton', 'Kol');
  Kolbutton.Align = alLeft;
  Kolbutton.Width = 100;
  Kolbutton.Height = 80;
  Formum.AddNewEvent(Kolbutton, tbeOnClick, 'KolbuttonTikla');


  KolResim = Formum.AddNewImage(Kolbutton, 'KolResim');
  KolResim.setImage(' https://r.resimlink.com/kolresim1.png" rel="nofollow - https://r.resimlink.com/kolresim1.png ');
  KolResim.Align = alClient;


  Sirtbutton = Formum.AddNewButton(BolgeAlan, 'Sirtbutton', 'Sırt');
  Sirtbutton.Align = alLeft;
  Sirtbutton.Width = 100;
  Sirtbutton.Height = 80;
  Formum.AddNewEvent(Sirtbutton, tbeOnClick, 'SirtbuttonTikla');


  SirtResim = Formum.AddNewImage(Sirtbutton, 'SirtResim');
  SirtResim.setImage(' https://r.resimlink.com/sirtresim1.png" rel="nofollow - https://r.resimlink.com/sirtresim1.png ');
  SirtResim.Align = alClient;


  Bacakbutton = Formum.AddNewButton(BolgeAlan, 'Bacakbutton', 'Bacak');
  Bacakbutton.Align = alLeft;
  Bacakbutton.Width = 100;
  Bacakbutton.Height = 80;
  Formum.AddNewEvent(Bacakbutton, tbeOnClick, 'BacakbuttonTikla');


  BacakResim = Formum.AddNewImage(Bacakbutton, 'BacakResim');
  BacakResim.setImage(' https://r.resimlink.com/bacakresim1.png" rel="nofollow - https://r.resimlink.com/bacakresim1.png ');
  BacakResim.Align = alClient;


  HareketAlani = Formum.AddNewPanel(AnaAlan, 'HareketAlani');
  HareketAlani.Align = alClient;
  HareketAlani.Margins.Top = 10;


  Squatbutton = Formum.AddNewButton(HareketAlani, 'Squatbutton', 'Squat');
  Squatbutton.Align = alTop;
  Squatbutton.Height = 40;
  Formum.AddNewEvent(Squatbutton, tbeOnClick, 'SquatbuttonTikla');


  Plankbutton = Formum.AddNewButton(HareketAlani, 'Plankbutton', 'Plank');
  Plankbutton.Align = alTop;
  Plankbutton.Height = 40;
  Formum.AddNewEvent(Plankbutton, tbeOnClick, 'PlankbuttonTikla');

  Ziplabutton = Formum.AddNewButton(HareketAlani, 'Ziplabutton', 'Zıplamalı Açma');
  Ziplabutton.Align = alTop;
  Ziplabutton.Height = 40;
  Formum.AddNewEvent(Ziplabutton, tbeOnClick, 'ZiplabuttonTikla');

  Mekikbutton = Formum.AddNewButton(HareketAlani, 'Mekikbutton', 'Mekik');
  Mekikbutton.Align = alTop;
  Mekikbutton.Height = 40;
  Formum.AddNewEvent(Mekikbutton, tbeOnClick, 'MekikbuttonTikla');


  Dagcibutton = Formum.AddNewButton(HareketAlani, 'Dagcibutton', 'Dağcı');
  Dagcibutton.Align = alTop;
  Dagcibutton.Height = 40;
  Formum.AddNewEvent(Dagcibutton, tbeOnClick, 'DagcibuttonTikla');


  Barbell_BicepsCurl = Formum.AddNewButton(HareketAlani, 'Barbell_BicepsCurlbutton', 'Barbell_BicepsCurl');
  Barbell_BicepsCurl.Align = alTop;
  Barbell_BicepsCurl.Height = 40;
  Formum.AddNewEvent(Barbell_BicepsCurl, tbeOnClick, 'Barbell_BicepsCurlbuttonTikla');

  
  Dumbell_Hammer_Curl = Formum.AddNewButton(HareketAlani, 'Dumbell_Hammer_Curlbutton', 'Dumbell_Hammer_Curl');
  Dumbell_Hammer_Curl.Align = alTop;
  Dumbell_Hammer_Curl.Height = 40;
  Formum.AddNewEvent(Dumbell_Hammer_Curl, tbeOnClick, 'Dumbell_Hammer_CurlbuttonTikla');
  
  
  Incline_Dumbell_Press = Formum.AddNewButton(HareketAlani, 'Incline_Dumbell_Pressbutton', 'Incline_Dumbell_Press');
  Incline_Dumbell_Press.Align = alTop;
  Incline_Dumbell_Press.Height = 40;
  Formum.AddNewEvent(Incline_Dumbell_Press, tbeOnClick, 'Incline_Dumbell_PressbuttonTikla');

  
  AlternateDumbellCurl = Formum.AddNewButton(HareketAlani, 'AlternateDumbellCurlbutton', 'AlternateDumbellCurl');
  AlternateDumbellCurl.Align = alTop;
  AlternateDumbellCurl.Height = 40;
  Formum.AddNewEvent(AlternateDumbellCurl, tbeOnClick, 'AlternateDumbellCurlbuttonTikla');
 
  
  Dumbell_Concentration_Curl = Formum.AddNewButton(HareketAlani, 'Dumbell_Concentration_Curlbutton', 'Dumbell_Concentration_Curl');
  Dumbell_Concentration_Curl.Align = alTop;
  Dumbell_Concentration_Curl.Height = 40;
  Formum.AddNewEvent(Dumbell_Concentration_Curl, tbeOnClick, ' Dumbell_Concentration_CurlbuttonTikla');
 
  
  Hyperextension = Formum.AddNewButton(HareketAlani, ' Hyperextensionbutton', ' Hyperextension');
  Hyperextension.Align = alTop;
  Hyperextension.Height = 40;
  Formum.AddNewEvent(Hyperextension, tbeOnClick, ' HyperextensionbuttonTikla');
 
  
  Latpull_down = Formum.AddNewButton(HareketAlani, ' Latpull_downbutton', ' Latpull_down');
  Latpull_down.Align = alTop;
  Latpull_down.Height = 40;
  Formum.AddNewEvent(Latpull_down, tbeOnClick, ' Latpull_downbuttonTikla');
  
  
  Bentoverow = Formum.AddNewButton(HareketAlani, ' Bentoverowbutton', ' Bentoverow');
  Bentoverow.Align = alTop;
  Bentoverow.Height = 40;
  Formum.AddNewEvent(Bentoverow, tbeOnClick, ' BentoverowbuttonTikla');

  
  Barbell_deadlift = Formum.AddNewButton(HareketAlani, '  Barbell_deadliftbutton', '  Barbell_deadlift');
  Barbell_deadlift.Align = alTop;
  Barbell_deadlift.Height = 40;
  Formum.AddNewEvent( Barbell_deadlift, tbeOnClick, '  Barbell_deadliftbuttonTikla');

  
  HackSquat = Formum.AddNewButton(HareketAlani, '   HackSquatbutton', '   HackSquat');
  HackSquat.Align = alTop;
  HackSquat.Height = 40;
  Formum.AddNewEvent( HackSquat, tbeOnClick, '    HackSquatbuttonTikla');


  LegPress = Formum.AddNewButton(HareketAlani, '   LegPressbutton', '   LegPress');
  LegPress.Align = alTop;
  LegPress.Height = 40;
  Formum.AddNewEvent( LegPress, tbeOnClick, '    LegPressbuttonTikla');


  Standing_LegCurl = Formum.AddNewButton(HareketAlani, '   Standing_LegCurlbutton', '   Standing_LegCurl');
  Standing_LegCurl.Align = alTop;
  Standing_LegCurl.Height = 40;
  Formum.AddNewEvent( Standing_LegCurl, tbeOnClick, '    Standing_LegCurlbuttonTikla');

  
  LyingLeg_Curl = Formum.AddNewButton(HareketAlani, '   LyingLegbutton', '   LyingLeg_Curl');
  LyingLeg_Curl.Align = alTop;
  LyingLeg_Curl.Height = 40;
  Formum.AddNewEvent( LyingLeg_Curl, tbeOnClick, '    LyingLeg_CurlbuttonTikla');

  
  LegExtension = Formum.AddNewButton(HareketAlani, '   LegExtensionbutton', '   LegExtension');
  LegExtension.Align = alTop;
  LegExtension.Height = 40;
  Formum.AddNewEvent( LegExtension, tbeOnClick, '    LegExtensionbuttonTikla');

  
  HareketBilgiYazi = Formum.AddNewLabel(HareketAlani, 'HareketBilgiYazi', '');
  HareketBilgiYazi.Align = alTop;
  HareketBilgiYazi.WordWrap = True;
  HareketBilgiYazi.TextSettings.Font.Size = 14;


  HareketResim = Formum.AddNewImage(HareketAlani, 'HareketResim');
  HareketResim.Align = alClient;
  HareketResim.Margins.Top = 10;

  Formum.Run;
}


yardımız için teşekkürler 





Cevaplar:
Mesajı Yazan: Emr.Erkmn
Mesaj Tarihi: 29 Temmuz 2025 Saat 15:35
Merhaba Kayra,
İlk aldığım hata;
80. satırda resimlinkbutton = Formum.AddNewButton(AnaAlan, 'buttonAlan');
Button 3 parametre alması gerekiyor. 2 parametre aldığı için hata veriyor. 
Diğer bir hata  Unit Main: Unknown identifier or variable is not declared: 'Barbell_BicepsCurl_'.
Source position: 90,23  

Değişkenin de yaşıyorsun. Değişkeni tanımlanmamış ve bu bir bileşen galiba. Bileşen eklenmemiş koda. 

İyi çalışmalar.





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