Dataform

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

*dataform*.show()

Views the dataform.

*dataform*.setheight(*value*)

Sets the height of the dataform.

*dataform*.addfieldtext(*caption*,*tag*,*defaultvalue*)

Adds a text field. The label, the reference tag and the default value must be entered.

*dataform*.addfielddate(*caption*,*tag*,*defaultvalue*)

Adds a date field. The label, the reference tag and the default value must be entered.

*dataform*.addfieldinteger(*caption*,*tag*,*defvalue*)

Adds an integer number field. The label, the reference tag and the default value must be entered.

*dataform*.addfieldlist(*caption*,*tag*,*values*,*defaultvalue*)

Adds a list field. The label, the reference tag, the list of values and the default value to be displayed must be entered.

*value* = *dataform*.closewithx

If the dataform is closed with the X of the controlbox, the value True is returned.

*dataform*.settitle(*title*)

Sets the dataform title.

*dataform*.setvalue(*tag*,*value*)

Sets a value in the dataform. The reference tag must be given to identify the row and the value.

*value* = *dataform*.getvalue(*tag*)

Retreive a value from the dataform. The reference tag must be given to identify the row.