** END HEADER -- do not remove this line // // Generated on 2023-07-25 // parameter bModal local f f = new squareForm() if (bModal) f.mdi = false // ensure not MDI f.readModal() else f.open() endif class squareForm of FORM with (this) onOpen = class::FORM_ONOPEN height = 16.0 left = 7.4286 top = 1.6818 width = 40.0 text = "" endwith this.ENTRYFIELD1 = new ENTRYFIELD(this) with (this.ENTRYFIELD1) onGotFocus = class::ENTRYFIELD1_ONGOTFOCUS height = 1.0 left = 16.0 top = 4.0455 width = 8.0 value = "" endwith this.PUSHBUTTON1 = new PUSHBUTTON(this) with (this.PUSHBUTTON1) onClick = class::PUSHBUTTON1_ONCLICK height = 1.0909 left = 13.0 top = 7.4091 width = 15.2857 text = "Calculate square" endwith this.ENTRYFIELD2 = new ENTRYFIELD(this) with (this.ENTRYFIELD2) height = 1.0 left = 16.0 top = 10.4545 width = 8.0 value = "" endwith function ENTRYFIELD1_onGotFocus() this.value = '' form.entryfield2.value = '' return function PUSHBUTTON1_onClick() //Because the default value of entryfield1 has been set to blank //dBASE sees any value entered as a character. VAL() is used to //convert the character(s) to numeric values. form.entryfield2.value = square(val(form.entryfield1.value)) return function form_onOpen() set procedure to square.prg return endclass