You are on page 1of 10

ALGORITMA

LAPORAN PEMBUATAN PROGRAM PENGGUNA TABEL

Disusun oleh:
Sri Novita Sari
2110110141012

PROGRAM STUDI DIPLOMA III REKAM MEDIS


AKADEMI PEREKAM INFORMASI KESEHATAN (APIKES)
IRIS PADANG
1. Program Tampil Data Combo Table

 Tampil awal data


thisform.txtNbp.Value=Nbp
thisform.txtNama.Value=Nama
thisform.txtAlamat.Value=Alamat
thisform.txtLahir.Value=lahir
thisform.txtKota.Value=kota
IF jenkel=1
thisform.txtJenkel.Value="pria"
ELSE
thisform.txtJenkel.Value="wanita"
ENDIF
IF status=.T.
thisform.txtstatus.Value="nikah"
ELSE
thisform.txtstatus.Value="lajang"
ENDIF
 Tampil activite
IF EOF()
WAIT windows ("data tidak ada, tekan sembarang tombol")
thisform.Release
ENDIF
thisform.tampildata
thisform.command1.setfocus
 Tombol awal
GO top
thisform.tampildata
thisform.Refresh

 Tombol akhir record


GO bottom
thisform.tampildata
thisform.Refresh

 Tombol sebelumnya
skip-1
IF bof()
GO top
ENDIF
thisform.tampildata
thisform.Refresh

 Tombol berikutnya
SKIP
IF EOF()
ENDIF
thisform.tampildata
thisform.Refresh

 Tombol selesai
thisform.Release

 Tombol command group


pil=thisform.commandgroup1.Value
DO CASE
CASE pil=1
GO top
CASE pil=2
GO bottom
CASE pil=3
skip-1
IF BOF()
GO top
ENDIF
CASE pil=4
SKIP
IF EOF()
GO bottom
ENDIF
OTHERWISE
thisform.Release
ENDCASE
thisform.tampildata
thisform.grdMahasiswa1.Refresh

2. Program grid dan option group

 Option group
pil=thisform.optiongroup1.Value

DO case
CASE pil=1
SET FILTER TO
CASE pil=2
SET FILTER TO jenkel=1
CASE pil=3
SET FILTER TO jenkel=2
CASE pil=4
SET FILTER TO jenkel= 1 AND kota="padang"
CASE pil=5
SET FILTER TO kota = "padang" OR jenkel=2
CASE pil=6
SET FILTER TO kota <> "padang"
CASE pil=7
SET FILTER TO status=.F. AND jenkel=2
ENDCASE

thisform.GrdMahasiswa1.refresh

 Command group
DO CASE
CASE pil=1
SET FILTER TO
CASE pil=2
SET FILTER TO jenkel=1
CASE pil=3
SET FILTER TO jenkel=2
CASE pil=4
SET FILTER TO jenkel=1 AND kota="padang"
CASE pil=5
SET FILTER TO kota="padang" OR jenkel=2
CASE pil=6
SET FILTER TO kota <>"padang"
ENDCASE
thisform.grdMahasiswa1.Refresh

3. Program cari dan edit data

 Unload
USE

 Load
USE mahasiswa1
SET ORDER TO Nbp
 Activate
thisform.txtNbp.Value=""
thisform.txtNama.Value=""
thisform.txtAlamat.Value=""
thisform.txtLahir.Value=""
thisform.optiongroup1.Value=0
thisform.optiongroup2.Value=0
thisform.txtKota.Value=""
thisform.txtNbp.Enabled=.t.
thisform.txtNama.Enabled=.f.
thisform.txtKota.Enabled=.f.
thisform.txtAlamat.Enabled=.f.

thisform.optiongroup1.Enabled=.f.
thisform.optiongroup2.Enabled=.f.
thisform.txtLahir.Enabled=.f.

thisform.command1.Enabled=.t.
thisform.command2.Enabled=.f.
thisform.command3.Enabled=.f.
thisform.command4.Enabled=.t.
thisform.txtNbp.SetFocus

 Tombol cari

IF EMPTY(THISFORM.txtNbp.Value)
thisform.txtNbp.SetFocus
ELSE SEEK
thisform.txtNbp.Value
IF FOUND()
thisform.txtNama.Value=Nama
thisform.txtAlamat.Value=alamat
thisform.txtLahir.Value=lahir
thisform.txtKota.Value=kota
IF jenkel=1
thisform.optiongroup1.Value=1
ELSE
thisform.optiongroup1.Value=2
ENDIF
IF status=.t.
thisform.optiongroup2.Value=1
ELSE
thisform.optiongroup2.Value=2
ENDIF
thisform.txtNbp.Enabled=.f.
thisform.txtNama.Enabled=.t.
thisform.optiongroup1.Enabled=.t.
thisform.optiongroup2.Enabled=.t.
thisform.txtAlamat.Enabled=.t.
thisform.txtLahir.Enabled=.t.
thisform.txtKota.Enabled=.t.
thisform.command1.Enabled=.f.
thisform.command2.Enabled=.t.
thisform.command3.Enabled=.t.
thisform.command4.Enabled=.f.
thisform.txtNama.SetFocus
thisform.grdMahasiswa1.Refresh
ELSE
MESSAGEBOX ("data mhs tsb tidak terdaftar...",0+32)
thisform.txtNbp.Value=""
thisform.txtNbp.SetFocus
ENDIF
ENDIF

 Tombol simpan

replace nama WITH


thisform.txtNama.Value
replace alamat WITH
thisform.txtAlamat.Value
replace lahir WITH
thisform.txtLahir.Value
replace kota WITH
thisform.txtkota.Value
IF thisform.optiongroup1.Value=1
replace jenkel WITH 1
ELSE
replace jenkel WITH 2
ENDIF
IF thisform.optiongroup2.Value=1
replace status WITH .t.
ELSE
replace status WITH .f.
ENDIF
thisform.grdMahasiswa1.Refresh()
thisform.activate

 Tombol batal
thisform.Activate

 Tombol keluar
thisform.Release

4. Program entri dan hapus data

 Tombol simpan

IF EMPTY(thisform.txtNama.Value)
MESSAGEBOX("nama diisi dong...!!!",48,"warning!!")
thisform.txtNama.SetFocus
RETURN
ENDIF
tgl=CTOD (thisform.txt_lahir.Value)
IF EMPTY(tgl)
MESSAGEBOX("tanggal salah / masih kosong",48,"warning!!")
RETURN
ENDIF
SCATTER MEMVAR blank
M.Nbp=thisform.txtNbp.Value
M.Nama=thisform.txtNama.Value
M.alamat=thisform.txtAlamat.Value
M.lahir=CTOD(thisform.txt_lahir.Value)
M.kota=thisform.txtKota.Value
M.jenkel=IIF(thisform.group_jnk.Value=1,1,2)
M.status=IIF(thisform.group_sta.Value=1,.t.,.f.)
M.catatan=thisform.edit1.Value
INSERT INTO mahasiswa1 FROM memvar

thisform.grdMahasiswa1.Refresh()
thisform.awaldata

 Tombol batal
thisform.awaldata()

 Tombol keluar
thisform.Release

 Tombol hapus

nkode=MESSAGEBOX("mau di hapus record ini?",4+32,"konfirmasi")


RETURN
PACK
thisform.mahasiswa1.refresh
SKIP
IF EOF()
skip-1
ENDIF
IF bof
MESSAGEBOX("data sudah habis"<64,"info")
thisform.Release
ENDIF

 Tombol konfirmasi

IF EMPTY(thisform.txtNbp.Value)
thisform.txtNbp.SetFocus
RETURN
ENDIF
IF SEEK(thisform.txtNbp.Value)
MESSAGEBOX ("Bp itu sudah ada broo...!!!",16,"by sri novita")
thisform.txtNbp.Value=""
thisform.txtNbp.SetFocus
RETURN
ENDIF
thisform.aturdata (.T.)
thisform.tmbkonfirmasi.Visible=.f.
thisform.tmbsave.Enabled= .T.
thisform.txtNbp.SetFocus

 Awal data

thisform.aturdata(.f.)
thisform.txtNbp.value=""
thisform.txtNama.Value=""
thisform.txtAlamat.Value=""
thisform.txt_lahir.Value=""
thisform.txtKota.Value=""
thisform.edit1.value=""
thisform.group_jnk.Value=1
thisform.group_sta.Value=1
thisform.tmbsave.Enabled=.f.
thisform.tmbkonfirmasi.Visible=.t.
thisform.txtNbp.SetFocus

 Atur data

PARAMETERS COBA
thisform.txtNbp.Enabled=.not.coba
thisform.txtNama.Enabled=coba
thisform.txtAlamat.Enabled=coba
thisform.txt_lahir.Enabled=coba
thisform.txtKota.Enabled=coba
thisform.group_jnk.Enabled=coba
thisform.group_sta.Enabled=coba
thisform.edit1.Enabled=coba

You might also like