add( ) example
The following function is an onOpen event handler for a ComboBox component. It creates a one-dimensional array from values in a field in a table and assigns that array as the dataSource property of the Select component. The table is already opened in the query sections1.
function sectionCombo_onOpen( )
this.aSections = new Array( )
if form.sections1.rowset.first( )
do
this.aSections.add( form.sections1.rowset.fields[ "Name" ].value )
until not form.sections1.rowset.next( )
endif
this.dataSource = "array this.aSections"