Einzelnen Beitrag anzeigen

shmia

Registriert seit: 2. Mär 2004
5.508 Beiträge
 
Delphi 5 Professional
 
#15

Re: Checkboxen mit gleichem Boolean-Wert zählen

  Alt 24. Nov 2006, 10:12
Hallo, das ist ja grausamer Code hier.
Es muss doch auffallen wenn man 6 Mal das Gleiche hinschreibt.
Lokale Variablen sind die Lösung.
Delphi-Quellcode:
var
   comp : TComponent;
   cb : TCheckbox;
....
   comp := FindComponent('CheckBox' + IntToStr(c3));
   if Assigned(comp) then
   begin
      cb := comp as TCheckbox;
      // und jetzt wird nur noch mit cb gearbeitet!!
Andreas
  Mit Zitat antworten Zitat