if file('whatevertable.dbf') drop table whatevertable endif if not file('whatevertable.dbf') create table whatevertable (id autoinc,trade character(15),wage_rate numeric(10,2),; fringes numeric(10,2)) insert into whatevertable (trade,wage_rate,fringes) values ("Electrician",120.00,12.00) insert into whatevertable (trade,wage_rate,fringes) values ("Plumber",110.00,11.00) insert into whatevertable (trade,wage_rate,fringes) values ("Brick layer",90.00,9.00) insert into whatevertable (trade,wage_rate,fringes) values ("Plasterer",90.00,9.00) endif ** END HEADER -- do not remove this line // // Generated on 14/12/2017 // parameter bModal local f f = new WHATEVERTABLEForm() if (bModal) f.mdi = false // ensure not MDI f.readModal() else f.open() endif class WHATEVERTABLEForm of FORM with (this) onOpen = class::FORM_ONOPEN colorNormal = "Aliceblue" height = 25.4545 left = 0.0 top = 0.0 width = 192.2857 text = "Whatevertable" scrollBar = 2 // Auto endwith this.WHATEVERTABLE1 = new QUERY() this.WHATEVERTABLE1.parent = this with (this.WHATEVERTABLE1) onOpen = class::WHATEVERTABLE1_onOpen left = 34.0 width = 12.0 height = 1.0 sql = 'select * from "whatevertable.dbf"' active = true endwith this.TEXTTRADE1 = new TEXT(this) with (this.TEXTTRADE1) height = 1.0 left = 80.0 top = 8.0 width = 5.7143 wrap = false colorNormal = "BtnText/Aliceblue" alignVertical = 2 // Bottom fontName = "Arial Narrow" fontSize = 11.0 fontBold = true fontItalic = true text = "Trade" endwith this.ENTRYFIELDTRADE1 = new ENTRYFIELD(this) with (this.ENTRYFIELDTRADE1) dataLink = form.whatevertable1.rowset.fields["trade"] height = 1.0 left = 80.0 top = 9.0 width = 32.0 fontName = "Arial Narrow" fontSize = 12.0 endwith this.ENTRYFIELDWAGE_RATE1 = new ENTRYFIELD(this) with (this.ENTRYFIELDWAGE_RATE1) dataLink = form.whatevertable1.rowset.fields["wage_rate"] height = 1.0 left = 93.0 top = 10.5 width = 8.0 fontName = "Arial Narrow" fontSize = 12.0 endwith this.ENTRYFIELDFRINGES1 = new ENTRYFIELD(this) with (this.ENTRYFIELDFRINGES1) dataLink = form.whatevertable1.rowset.fields["fringes"] height = 1.0 left = 93.0 top = 11.5 width = 8.0 fontName = "Arial Narrow" fontSize = 12.0 endwith this.ENTRYFIELDTOTAL1 = new ENTRYFIELD(this) with (this.ENTRYFIELDTOTAL1) dataLink = form.whatevertable1.rowset.fields["total"] height = 1.0 left = 93.0 top = 12.5 width = 8.0 fontName = "Arial Narrow" fontSize = 12.0 endwith this.TITLE1 = new TEXT(this) with (this.TITLE1) height = 2.0 left = 1.0 top = 0.0 width = 21.1429 variableHeight = true colorNormal = "Black/Aliceblue" fontSize = 14.0 fontBold = true fontItalic = true text = "Whatevertable" endwith this.rowset = this.whatevertable1.rowset function form_onOpen() return function WHATEVERTABLE1_onOpen() c = new field() c.fieldName := "Total" this.rowset.fields.add(c) this.rowset.fields["total"].beforeGetValue := {||this.parent["wage_rate"].value + this.parent["fringes"].value} return endclass