The $RC does just that, capture the return code that would otherwise fall out onto the floor. As I said, very optimistic code simply to demonstrate the basics. You will need to handle the null array elements.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.