BLOGGER TEMPLATES AND TWITTER BACKGROUNDS

Sabtu, 27 April 2013

Perulangan (^_^)

procedure TForm2.FormClick(Sender: TObject);
var
a,b,c : integer;
begin
  for a:=1 to 31 do
  ComboBox1.Items.Aad(IntToStr(a));
  for b:=1 to 12 do
  ComboBox2.Items.Aad(IntToStr(b));
  for c:=1990 to 2013 do
  ComboBox3.Items.Aad(IntToStr(c));
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
  if ComboBox2.Text='1' then
  begin
    ListBox1.Items.Add('Tanggal Lahir'+ComboBox1.Text+'-'+'Januari'+'-'+ComboBox3.Text);
  end

  else if ComboBox2.Text='2' then
  begin
    ListBox1.Items.Add('Tanggal Lahir'+ComboBox1.Text+'-'+'Februari'+'-'+ComboBox3.Text);
  end

  else if ComboBox2.Text='3' then
  begin
    ListBox1.Items.Add('Tanggal Lahir'+ComboBox1.Text+'-'+'Maret'+'-'+ComboBox3.Text);
  end

  else if ComboBox2.Text='4' then
  begin
    ListBox1.Items.Add('Tanggal Lahir'+ComboBox1.Text+'-'+'April'+'-'+ComboBox3.Text);
  end

  else if ComboBox2.Text='5' then
  begin
    ListBox1.Items.Add('Tanggal Lahir'+ComboBox1.Text+'-'+'Mei'+'-'+ComboBox3.Text);
  end

  else if ComboBox2.Text='6' then
  begin
    ListBox1.Items.Add('Tanggal Lahir'+ComboBox1.Text+'-'+'Juni'+'-'+ComboBox3.Text);
  end

  else if ComboBox2.Text='7' then
  begin
    ListBox1.Items.Add('Tanggal Lahir'+ComboBox1.Text+'-'+'Juli'+'-'+ComboBox3.Text);
  end

  else if ComboBox2.Text='8' then
  begin
    ListBox1.Items.Add('Tanggal Lahir'+ComboBox1.Text+'-'+'Agustus'+'-'+ComboBox3.Text);
  end

  else if ComboBox2.Text='9' then
  begin
    ListBox1.Items.Add('Tanggal Lahir'+ComboBox1.Text+'-'+'September'+'-'+ComboBox3.Text);
  end

  else if ComboBox2.Text='10' then
  begin
    ListBox1.Items.Add('Tanggal Lahir'+ComboBox1.Text+'-'+'Oktober'+'-'+ComboBox3.Text);
  end

  else if ComboBox2.Text='11' then
  begin
    ListBox1.Items.Add('Tanggal Lahir'+ComboBox1.Text+'-'+'November'+'-'+ComboBox3.Text);
  end

  else if ComboBox2.Text='12' then
  begin
    ListBox1.Items.Add('Tanggal Lahir'+ComboBox1.Text+'-'+'November'+'-'+ComboBox3.Text);
  end
end.

Selasa, 02 April 2013

BERMAIN-MAIN DENGAN PERCABANGAN DELPHI


procedure TForm1.Button1Click(Sender: TObject);
var
a,b,c,d : real;
begin
if edit1.Text>edit2.Text then
  begin
    a:=strtofloat(edit1.text);
    b:=strtofloat(edit2.text);
    c:=strtofloat(edit3.text);
    d:=(a-b)*c;
    edit4.Text:=floattostr(d);
    label1.Caption:='-';
  end
else
if edit1.Text  begin
    a:=strtofloat(edit1.text);
    b:=strtofloat(edit2.text);
    c:=strtofloat(edit3.text);
    d:=(a+b)*c;
    edit4.Text:=floattostr(d);
    label1.Caption:='+';
  end
end;

end.