1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What does this short code do?

Discussion in 'Help and Support' started by javaChick, Jul 21, 2008.

  1. javaChick

    javaChick New Member

    Joined:
    Jul 10, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Could someone explain me what does this code do?
    Code:
    unit XX;
    interface
    
    uses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls, Main;
    
    type
      TComponentList = class(TForm)
        ListBox1: TListBox;
        procedure ListBox1Click(Sender: TObject);
      private
    
      public
    
      end;
    
    var
      ComponentList: TComponentList;
    
    implementation
    
    {$R *.DFM}
    
    procedure TComponentList.ListBox1Click(Sender: TObject);
    var
       i:Integer;
       MyName:string;
       MyObject:TObject;
    begin
    ListOfSelectedObjects.UnSelect; 
    
    MyName:='';
    for i:=0 to ListBox1.Items.Count-1 do
       if ListBox1.Selected[i] then MyName:=ListBox1.Items[i];
    if MyName='' then ShowMessage('Greska : Ime nije pronadjeno);
    MyObject:=GetObjectByName(MyName);
    MyObject.Select;
    MyObject.Draw;
    
    end;
    
    end.interface
    
    uses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls, Main;
    
    type
      TComponentList = class(TForm)
        ListBox1: TListBox;
        procedure ListBox1Click(Sender: TObject);
      private
    
      public
    
      end;
    
    var
      ComponentList: TComponentList;
    
    implementation
    
    {$R *.DFM}
    
    procedure TComponentList.ListBox1Click(Sender: TObject);
    var
       i:Integer;
       MyName:string;
       MyObject:TObject;
    begin
    ListOfSelectedObjects.UnSelect; 
    
    MyName:='';
    for i:=0 to ListBox1.Items.Count-1 do
       if ListBox1.Selected[i] then MyName:=ListBox1.Items[i];
    if MyName='' then ShowMessage('Greska : Ime nije pronadjeno);
    MyObject:=GetObjectByName(MyName);
    MyObject.Select;
    MyObject.Draw;
    
    end;
    
    end.
    
     

Share This Page