if file('mb1.dbf')
drop table mb1
endif
if not file('mb1.dbf')
create table mb1 (name character(15),str numeric(10,0),def numeric(10,0))
insert into mb1 (name,str,def) values ("Bob",123.00,456.00)
insert into mb1 (name,str,def) values ("Fred",789.00,123.00)
endif
** END HEADER -- do not remove this line
//
// Generated on 2023-11-20
//
parameter bModal
local f
f = new increment_a_valueForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif
class increment_a_valueForm of FORM
with (this)
height = 21.6818
left = 19.4286
top = 6.5455
width = 72.7143
text = ""
endwith
this.WEF11 = new DATABASE()
this.WEF11.parent = this
with (this.WEF11)
left = 55.0
width = 4.0
height = 1.0
databaseName = "WEF1"
active = true
endwith
this.MB11 = new QUERY()
this.MB11.parent = this
with (this.MB11)
left = 56.0
top = 1.0
width = 3.0
height = 1.0
database = form.wef11
sql = "select * from MB1.DBF"
active = true
endwith
this.GRID1 = new GRID(this)
with (this.GRID1)
dataLink = form.mb11.rowset
height = 4.5
left = 5.8571
top = 3.1364
width = 60.8571
endwith
this.PUSHBUTTON1 = new PUSHBUTTON(this)
with (this.PUSHBUTTON1)
onClick = class::PUSHBUTTON1_ONCLICK
height = 1.8636
left = 15.0
top = 9.6364
width = 15.2857
text = "Increment Bob's STR"
endwith
this.PUSHBUTTON2 = new PUSHBUTTON(this)
with (this.PUSHBUTTON2)
onClick = class::PUSHBUTTON2_ONCLICK
height = 1.8636
left = 42.5714
top = 9.6364
width = 15.2857
text = "Increment Fred's STR"
endwith
this.PUSHBUTTON3 = new PUSHBUTTON(this)
with (this.PUSHBUTTON3)
onClick = class::PUSHBUTTON3_ONCLICK
height = 1.8636
left = 15.0
top = 12.7727
width = 15.2857
text = "Increment Bob's DEF"
endwith
this.PUSHBUTTON4 = new PUSHBUTTON(this)
with (this.PUSHBUTTON4)
onClick = class::PUSHBUTTON4_ONCLICK
height = 1.8636
left = 42.5714
top = 12.7727
width = 15.2857
text = "Increment Fred's DEF"
endwith
this.SPINBOX1 = new SPINBOX(this)
with (this.SPINBOX1)
onChange = class::SPINBOX1_ONCHANGE
dataLink = form.mb11.rowset.fields["str"]
height = 1.0
left = 17.0
top = 19.0
width = 8.0
rangeMax = 100
rangeMin = 1
endwith
this.TEXTLABEL1 = new TEXTLABEL(this)
with (this.TEXTLABEL1)
height = 1.0
left = 4.5714
top = 19.0
width = 12.0
text = " STR"
endwith
this.SPINBOX2 = new SPINBOX(this)
with (this.SPINBOX2)
onChange = class::SPINBOX2_ONCHANGE
dataLink = form.mb11.rowset.fields["def"]
height = 1.0
left = 53.4286
top = 19.0
width = 8.0
rangeMax = 100
rangeMin = 1
endwith
this.TEXTLABEL2 = new TEXTLABEL(this)
with (this.TEXTLABEL2)
height = 1.0
left = 39.8571
top = 19.0
width = 12.0
text = "DEF"
endwith
this.TEXTLABEL3 = new TEXTLABEL(this)
with (this.TEXTLABEL3)
height = 1.0
left = 9.2857
top = 15.6364
width = 51.1429
text = "Select the correct record in the grid before changing a value."
endwith
this.ENTRYFIELD1 = new ENTRYFIELD(this)
with (this.ENTRYFIELD1)
when = {||false}
dataLink = form.mb11.rowset.fields["name"]
height = 1.0
left = 30.4286
top = 17.1818
width = 8.0
endwith
this.TEXTLABEL4 = new TEXTLABEL(this)
with (this.TEXTLABEL4)
height = 1.0
left = 18.4286
top = 17.2727
width = 12.0
text = "Name"
endwith
this.rowset = this.mb11.rowset
function PUSHBUTTON1_onClick()
form.mb11.rowset.applyLocate("name ='Bob'") //Go to the correct record
form.mb11.rowset.fields['str'].value ++ //Increment the value
form.mb11.rowset.save() //Save the new value
return
function PUSHBUTTON2_onClick()
form.mb11.rowset.applyLocate("name ='Fred'")
form.mb11.rowset.fields['str'].value ++
form.mb11.rowset.save()
return
function PUSHBUTTON3_onClick()
form.mb11.rowset.applyLocate("name ='Bob'")
form.mb11.rowset.fields['def'].value ++
form.mb11.rowset.save()
return
function PUSHBUTTON4_onClick()
form.mb11.rowset.applyLocate("name ='Fred'")
form.mb11.rowset.fields['def'].value ++
form.mb11.rowset.save()
return
function SPINBOX1_onChange()
form.mb11.rowset.save() //save the new value which will the upate the grid
return
function SPINBOX2_onChange()
form.mb11.rowset.save() //save the new value which will the upate the grid
return
endclass
Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0