in reply to program doesnt work for all elements of the array

G'day iThunder,

Welcome to the monastery.

"Any suggestions??"

Due to the unreadability of your post, I have only one suggestion at this point: please put your code in <code>...</code> tags and your text in <p>...</p> tags. Once you've done that, you'll probably find that useful comments are forthcoming on whatever your problem happens to be.

Here's some links that might help you with that:

-- Ken