OOP Delphi

//Nuh Eroğlu
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TGunler = record
tursira : integer;
ingsira : integer;
isim : wideString;
name : WideString;
end;
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Button3: TButton;
procedure Button3Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
gunler : array [0..6] of TGunler;
implementation
{$R *.dfm}
function neolursabul(bilgi:WideString):WideString;
var
sayac : integer;
I,Durum : integer;
begin
result := 'Yok';
for sayac := low(gunler) to high(gunler) do begin
val(bilgi,I,Durum);
if gunler[sayac].tursira = I then
result := gunler[sayac].name + ' ' + IntToStr(gunler[sayac].ingsira) ;
if gunler[sayac].isim = bilgi then
result := gunler[sayac].name + ' ' + IntToStr(gunler[sayac].ingsira) ;
if gunler[sayac].name = bilgi then
result := gunler[sayac].isim + ' ' + IntToStr(gunler[sayac].tursira) ;
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Edit2.Text:=neolursabul(trim(edit1.text));
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
gunler[0].tursira := 1 ; gunler[0].isim := 'Pazartesi'; gunler[0].name := 'Monday' ; gunler[0].ingsira := 2 ;
gunler[1].tursira := 2 ; gunler[1].isim := 'Salı' ; gunler[1].name := 'Tuesday' ; gunler[1].ingsira := 3 ;
gunler[2].tursira := 3 ; gunler[2].isim := 'Çarşamba' ; gunler[2].name := 'Wednesday'; gunler[2].ingsira := 4 ;
gunler[3].tursira := 4 ; gunler[3].isim := 'Perşembe' ; gunler[3].name := 'Thursday' ; gunler[3].ingsira := 5 ;
gunler[4].tursira := 5 ; gunler[4].isim := 'Cuma' ; gunler[4].name := 'Friday' ; gunler[4].ingsira := 6 ;
gunler[5].tursira := 6 ; gunler[5].isim := 'Cumartesi'; gunler[5].name := 'Saturday' ; gunler[5].ingsira := 7 ;
gunler[6].tursira := 7 ; gunler[6].isim := 'Pazar' ; gunler[6].name := 'Sunday' ; gunler[6].ingsira := 1 ;
end;
//Nuh EROĞLU
end.