The code is enumerating an array. You replaced the line that displays the result with one that stores the result in a variable:
 Code:
          $Key = Get_Product_Key(ReadValue(Join(Split($value,'<=>DigitalProductId'),''), 'DigitalProductID'))
		  $CDKey = $Product + ': ' + $Key
;            ? $Product + ': ' + $Key
thus, at the end of the For/Next loop, the $CDKey will contain only the last product/key value pair. You either need to use the array or replace the assignmentn with a database write.

Reading back to the beginning, you started with something that was not optimally structured, and seem to have continued on that path with your changes - not good... I'll be back later with some suggestions - I'll need some time to digest this.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D