Thema: Delphi Find Component

Einzelnen Beitrag anzeigen

Hellcat

Registriert seit: 27. Feb 2003
60 Beiträge
 
Delphi 6 Personal
 
#5
  Alt 26. Mär 2003, 16:12
Ich poste hier mal die Unit:
Delphi-Quellcode:
unit UnitFunc;

interface

uses SysUtils, ExtCtrls, StdCtrls, Controls, Classes, Graphics, Dialogs; {Standard-Units auf die zurückgegriffen wird}

    procedure Farbewechseln (Sender: TPanel; Button: TMousebutton);
    function Zeitangabe:string;
    function THL (Sender: TImage; Button: TMousebutton; Bild: boolean): boolean;
    function Sound (Sender: TImage; Button: TMousebutton; Bild: boolean): boolean;
    function Schloss (Sender: TImage; Button: TMousebutton; Bild: boolean): boolean;
    procedure speichern;

implementation

procedure speichern;
var save: Textfile;
    Hname, Zeit, HFarbe, kette: string;
    Schl, THL, Sound:boolean;
    i: integer;
begin
  kette := '';
  for i := 1 to 35 do
  begin
    kette := kette + ((FindComponent('PanLab' + IntToStr(i)) as TLabel) .Caption,
                  (FindComponent('PanLabT' + Inttostr(i)) as TLabel).caption,
                  IntToHex(((FindComponent('PanHalle' + InttoStr(i))as TPanel).Color),6),
                  BoolToStr(bildTHL[i]), BoolToStr(bildSchl[i]),BoolToStr(bildSound[i]));
  end;
end;
2+2=5 (for large values of 2)
  Mit Zitat antworten Zitat