Selasa, 26 Juni 2012

hitung nilai

Buttob baru
procedure TForm1.btnbaruClick(Sender: TObject);
begin
bersih ;
btn_simpan ;
simpan :=True ;
end;

button ubah
procedure TForm1.btnubahClick(Sender: TObject);
begin
btn_simpan ;
simpan :=False ;
tampil ;
end;

button simpan
procedure TForm1.btnsimpanClick(Sender: TObject);
begin
if simpan then
begin
  with qrynilai do
  begin
    Append ;
    fieldbyname('kode_nilai').AsString := edtkode.Text ;
    fieldbyname('NIM').AsString := cbbnim .Text ;
    fieldbyname('Nama').AsString := edtnama.Text ;
    fieldbyname('matakuliah').AsString := edtmatakuliah.Text ;
    fieldbyname('nilai_tugas').Asinteger := strtoint(edtnt.Text);
    fieldbyname('nilai_quis').Asinteger:= strtoint(edtnq.text);
    fieldbyname('nilai_mid').Asinteger := strtonit(edtnm.Text);
    fieldbyname('nilai_semester).Asinteger := strtoint(edtns.text);
    Post;
    end;
    end;
    else;
    with qrynilai do
    begin
      Edit;
      fieldbyname('kode_nilai').AsString := edtkode.Text ;
    fieldbyname('NIM').AsString := cbbnim .Text ;
    fieldbyname('Nama').AsString := edtnama.Text ;
    fieldbyname('matakuliah').AsString := edtmatakuliah.Text ;
    fieldbyname('nilai_tugas').Asinteger := strtoint(edtnt.Text);
    fieldbyname('nilai_quis').Asinteger:= strtoint(edtnq.text);
    fieldbyname('nilai_mid').Asinteger := strtonit(edtnm.Text);
    fieldbyname('nilai_semester).Asinteger := strtoint(edtns.text);
    Post;
    end;
    btn_baru ;
    bersih;
  end;
end;

button hapus
procedure TForm1.btnhapusClick(Sender: TObject);
begin
if MessageDlg('hapus record aktif',mtConfirmation,[mbYes,mbno],0)=mryes then qrynilai.Delete;
end;

button batal
procedure TForm1.btnbatalClick(Sender: TObject);
begin
btn_baru ;
bersih ;
end;

button first
procedure TForm1.btnfirstClick(Sender: TObject);
begin
qrynilai.First;
end;

button prior
procedure TForm1.btnpriorClick(Sender: TObject);
begin
qrynilai.Prior;
end;

button next
procedure TForm1.btnnextClick(Sender: TObject);
begin
qrynilai.Next;
end;

button last
procedure TForm1.btnlastClick(Sender: TObject);
begin
qrynilai.Last;
end;
end.

hitung=
begin
edtakhir.text:=floattostr(((strtofloat(edttugas.text)+strtofloat(edtquis.text)+strtofloat(edtmid.text))*0.2)+(strtofloat(edtsemester.text)*0.4));

Tidak ada komentar:

Posting Komentar

Read more: http://dapur-tutorial.blogspot.com/2012/03/cara-membuat-atau-memasang-widget.html#ixzz2AGSq9KCx