Basic Algorithmic using Form
Click here to download / see in pdf Document
Basic Algorithm using Form in Visual Foxpro
· Add new Form-Property name as : DataBaru
· Add new Form-Method name as : IsiText
· Add new Form-Method name as : DetailOn
· Add new Form-Method name as : DetailOff
Form.Init
*** Program ID
* FormName : frmNAMAFORM
* Programmer : FIRDAUS MAULANA (www.daoush.net)
* Database : dbsNAMADATABASE
* LastUpdate : Sept 26 2002
* Remarks : Form untuk . . . . . . . . . . . .
*** Default Property / Variable
Form.Load
*** Closing and Open Tabel + Index
close database
use Tabel index Tabel in 0 Exclusive
Form.Avtivate
*** Check Selected Table
if used(“Tabel”)
select Tabel
endif
thisform.refresh
Form.Unload
*** close data
close database
*** Call DetailOff
Thisform.DetailOff
Form.IsiText
*** Load from Field / table
Thisform.txtField.value = Tabel.Field
Thisform.refresh
Form.DetailOn
*** Navigasi Off
Thisform.cmdNavigasi.enabled = .f.
*** txtField On
Thisform.txtField.enabled = .t.
Thisform.txtFieldAwal.setfocus
Form.DetailOff
*** Navigasi On
Thisform.cmdNavigasi.enabled = .t.
*** Loading data from table
Thisform.IsiText
*** txtField Off
Thisform.txtField.enabled = .f.
*** Reset Databaru Flag/Switch = .f.
Thisform.DataBaru = .f.
cmdADD.Click
*** Set Databaru Flag/Switch = .t.
Thisform.DataBaru = .t.
*** Call DetailOn
Thisform.DetailOn
cmdEDIT.Click
*** Call DetailOn
Thisform.DetailOn
cmdDELETE.Click
local vYT
*** Check if there is no record to delete ..
if reccount() = 0
return
endif
*** Confirmation for Delete data
vYT = messagebox(“Data dihapus ?”, 32+4 , “Konfirmasi”)
if vYT = 6 &&.. Yes
delete
pack
endif
*** Re-Load data from table
Thisform.IsiText
cmdNEXT.Click
if eof()
return
endif
skip
if eof()
skip –1
endif
*** Re-Load data from table
Thisform.IsiText
cmdPREVIOUS.Click
if bof()
return
endif
skip -1
if bof()
skip
endif
*** Re-Load data from table
Thisform.IsiText
cmdSAVE.Click
*** Check for NewData and Unique Primary Key
select Tabel
set order to tag FieldKunci
if Thisform.DataBaru
if seek( thisform.txtFieldKunci.value )
messagebox(“Data sudah ada”,16,”Data Error”)
return
else
append blank
endif
endif
*** Saving data
replace Field with thisform.txtField.value
*** Call DetailOff
Thisform.DetailOff
cmdCANCEL.Click
*** Call DetailOff
Thisform.DetailOff
13.07.2008. 20:37
This article hasn't been commented yet.
Write a comment
* = required field