if file('locate_apostrophe.dbf') // drop table locate_apostrophe endif if not file('locate_apostrophe.dbf') create table locate_apostrophe (id autoinc,name character(15)) insert into locate_apostrophe (name) values ("Abel") insert into locate_apostrophe (name) values ("O'Neil") insert into locate_apostrophe (name) values ("'t Veer") insert into locate_apostrophe (name) values ("Baker") endif ** END HEADER -- do not remove this line // // Generated on 2022-04-06 // parameter bModal local f f = new locate_apostropheForm() if (bModal) f.mdi = false // ensure not MDI f.readModal() else f.open() endif class locate_apostropheForm of FORM with (this) height = 16.0 left = 32.5714 top = 5.0909 width = 53.1429 text = "" endwith this.LOCATE_APOSTROPHE1 = new QUERY(this) with (this.LOCATE_APOSTROPHE1) left = 4.0 top = 1.0 width = 14.0 height = 1.0 sql = "select * from locate_apostrophe" active = true endwith with (this.LOCATE_APOSTROPHE1.rowset) locateOptions = 3 // Match Partial Length and Ignore Case endwith this.GRID1 = new GRID(this) with (this.GRID1) dataLink = form.locate_apostrophe1.rowset height = 8.0 left = 6.4286 top = 2.8182 width = 39.2857 endwith this.ENTRYFIELD1 = new ENTRYFIELD(this) with (this.ENTRYFIELD1) height = 1.0 left = 11.2857 top = 13.0 width = 10.5714 value = "'t Veer" endwith this.PUSHBUTTON1 = new PUSHBUTTON(this) with (this.PUSHBUTTON1) onClick = class::PUSHBUTTON1_ONCLICK height = 1.0909 left = 28.5714 top = 12.9091 width = 15.2857 text = "Locate" endwith this.rowset = this.locate_apostrophe1.rowset function escape_apostrophe(cString) // Add \ as an escape charater before ' for n = len(cString) to 1 step -1 if substr(cString,n,1) = ['] cString = stuff(cString,at(['],cString),0,[\]) endif next return cString function PUSHBUTTON1_onClick() cEsc = class::escape_apostrophe((form.entryfield1.value)) form.rowset.applyLocate([name = ']+cEsc+[']) return endclass