Lets us say that you have an array aData where each element is an array of { CustomerNo, CustomerName, City } ;
LOCAL hData := { "customerno" => 1,;
"customername" =>2,;
"city" =>3 }
:SetUserDataSet( "Customers", "CustomerNo;CustomerName;City", ;
{ || nAt := 1 },;
{ || nAt++ },;
{ || nAt-- },;
{ || nAt > LEN( aData ) },;
{ |cFld| nCol := hGet( hData, LOWER( cFld ) ), aData[ nAt, nCol ] } )
That will do it.
If you have other files with a relationship then you would need to resync() just the affected workarea.
For example, lets say you have an invoices table that relates to the customer number on the array, then you need to manually move the pointer on the invoices workarea and resync it every time you change row on the array, like this:
bResync := { |n| "Invoices"->( dbSeek( aData[ n, 1 ] ) ), oFrh:Resync( "invoices" ) }
:SetWorkArea( "Invoices", Select( "invoices" ) )
:SetUserDataSet( "Customers", "CustomerNo;CustomerName;City", ;
{ || nAt := 1, EVAL( bResync, nAt ) },;
{ || nAt++, EVAL( bResync, nAt ) },;
{ || nAt--, EVAL( bResync, nAt ) },;
{ || nAt > LEN( aData ) },;
{ |cFld| nCol := iif( hHasKey( hData, LOWER( cFld ) ), hGet( hData, LOWER( cFld ) ), 1 ),;
aData[ nAt, nCol ] } )
Reinaldo.