The dataform is a compilation window used to collect requests from the user. It's possibile add different types of selection fields according to your needs.
form = program.newdataform()
form.settitle("Find costumer")
form.addfieldtext("Name","NAMECOSTUMER","")
form.show()
if form.closewithx == true then
--exit to script
do return end
end
table = database.getsql("SELECT * FROM customer WHERE nome=’" .. form.getvalue("NAMECOSTUMER") .. "’")
if table.countrows() > 0 then
program.showconfirm("Customer found")
else
program.showerror("Customer not found")
end
Views the dataform.
Sets the height of the dataform.
Adds a text field. The label, the reference tag and the default value must be entered.
Adds a date field. The label, the reference tag and the default value must be entered.
Adds an integer number field. The label, the reference tag and the default value must be entered.
Adds a list field. The label, the reference tag, the list of values and the default value to be displayed must be entered.
If the dataform is closed with the X of the controlbox, the value True is returned.
Sets the dataform title.
Sets a value in the dataform. The reference tag must be given to identify the row and the value.
Retreive a value from the dataform. The reference tag must be given to identify the row.