if file('test_beginappend.dbf') // drop table test_beginappend endif if not file('test_beginappend.dbf') create table test_beginappend (id autoinc,data character(15)) use test_beginappend exclusive index on id tag id use endif ** END HEADER -- do not remove this line // // Generated on 2023-10-17 // parameter bModal local f f = new test_beginappendForm() if (bModal) f.mdi = false // ensure not MDI f.readModal() else f.open() endif class test_beginappendForm of FORM with (this) height = 16.0 left = 13.7143 top = 7.2273 width = 58.1429 text = "" endwith this.TEST_BEGINAPPEND1 = new QUERY(this) with (this.TEST_BEGINAPPEND1) left = 2.0 width = 14.0 height = 1.0 sql = 'select * from "D:\Examples\Plus2019\test_beginappend.DBF"' active = true endwith with (this.TEST_BEGINAPPEND1.rowset) indexName = "ID" endwith this.GRID1 = new GRID(this) with (this.GRID1) dataLink = form.test_beginappend1.rowset height = 11.1818 left = 8.5714 top = 0.6364 width = 42.2857 endwith this.PUSHBUTTON1 = new PUSHBUTTON(this) with (this.PUSHBUTTON1) onClick = class::PUSHBUTTON1_ONCLICK height = 1.0909 left = 3.7143 top = 13.2273 width = 15.2857 text = "Add 3 records" endwith this.PUSHBUTTON2 = new PUSHBUTTON(this) with (this.PUSHBUTTON2) onClick = class::PUSHBUTTON2_ONCLICK height = 1.0909 left = 22.5714 top = 13.2273 width = 15.2857 text = "Drop table" endwith this.PUSHBUTTON3 = new PUSHBUTTON(this) with (this.PUSHBUTTON3) onClick = class::PUSHBUTTON3_ONCLICK height = 1.0909 left = 41.4286 top = 13.2273 width = 15.2857 text = "ZAP table" endwith this.rowset = this.test_beginappend1.rowset function PUSHBUTTON1_onClick() for n = 1 to 3 form.rowset.beginappend() form.rowset.fields['data'].value = ''+n form.rowset.save() next return function PUSHBUTTON2_onClick() form.test_beginappend1.active = false drop table test_beginappend create table test_beginappend (id autoinc,data character(15)) use test_beginappend exclusive index on id tag id use form.test_beginappend1.active = true return function PUSHBUTTON3_onClick() cSafety = set('safety') set safety off form.test_beginappend1.active = false use test_beginappend exclusive zap pack use set safety &cSafety form.test_beginappend1.active = true return endclass