The following event handler creates a new row, carrying over the values in the current row. The values in the current row are copied to a temporary array, a new row is created, and the values are copied from the array.

function newButton_onClick

   local a, n 

   a = new Array( ) 

   for n = 1 to form.rowset.fields.size 

      a.add( form.rowset.fields[ n ].value ) 

   endfor 

   form.rowset.beginAppend( ) 

   for n = 1 to form.rowset.fields.size 

      form.rowset.fields[ n ].value := a[ n ] 

   endfor