How-to copy from record list typeA into record list typeB using a Extensions.

How-to copy from record list typeA into record list typeB using a Extensions.

  

Simple example to show how to copy from two different record list types: ItemA RecordList ---> ItemB RecordList.


public
void MssGetItemList(RLItemARecordList ssItemAList, out RLItemBRecordList ssItemBList)

        {


            ssItemBList = new RLItemBRecordList(null);

 

            RCItemBRecord rec = new RCItemBRecord(null);            //Create a new ItemB record            

 

           
            try

 

            {

 

                // Call Record List "StartIteration" to ensure the iteration starts from the beginning of the list

                ssItemAList.StartIteration();

 

                // Record List "Eof" property indicates if we're in the end of the list

                while (!ssItemAList.Eof)

                {


 

                    // Access "CurrentRec" to retrieve current record information from ItemA RecordList and assign the value to ItemB Record

                    rec.ssSTItemB.ssName = ssItemAList.CurrentRec.ssSTItemA.ssName;

                    ssItemBList.Append(rec); //Apend ItemB record to end of ItemB RecordList
                    

                    // call "Advance" to move to the next record in the list

                    ssItemAList.Advance(); 

                }

            }

            finally

            {

 

                // Indicate that we're no longer iterating the record

                ssItemAList.EndIteration();

            }

} // MssGetItemList