USE orders ORDER tag cust_id oObj = CREATEOBJECT('relation') lcCustID = ' ' SCAN IF cust_id # lcCustID oObj.AddProperty(TRIM(cust_id),CreateObject("relation")) lcCustID = cust_id ENDIF with eval('oObj.'+TRIM(cust_id)) .AddProperty('O'-ALLTRIM(order_id),'') endwith SCATTER NAME ('oObj.'+cust_id-'.O'-ALLTRIM(order_id)) endscan* Or an easier one is to get all into an array property :
USE orders ORDER tag cust_id oObj = CREATEOBJECT('relation') oObj.Addproperty('arrRecords['+trans(reccount())+']',.null.) SCAN scatter name oObj.arrRecords[recno()] endscan ? oObj.arrRecords[125].cust_id ? oObj.arrRecords[125].order_id ? oObj.arrRecords[125].Order_Date ? oObj.arrRecords[125].Order_Amt *Verify go 125 ? ? cust_id ? order_id ? Order_Date ? Order_AmtCetin