Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Help and Support (http://www.go4expert.com/community/help-and-support/)
-   -   What does this short code do? (http://www.go4expert.com/community/short-code-t12301/)

javaChick 21Jul2008 16:58

What does this short code do?
 
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.



All times are GMT +5.5. The time now is 14:23.