How to append to array within conditional block in ksh/korn shell?

Hi,
I have one array created and some values are there in ksh. I want to append some other values to it based on some condition in if statement.

#!/bin/ksh
echo "---------------------------------------------------"
        set -A ipaddr_arr $(egrep -v '^#|^::|^$' /etc/hosts |awk '{print $1}' | uniq) #hosts ips
        set +A ipaddr_arr $(egrep -v '^#|^::|^$' /etc/hosts |awk '{print $1}') 


        if [ "$os" = "solaris" ]
        then
                set +A ipaddr_arr $(egrep -v '^#|^::|^$' /etc/hosts |awk '{print $1}')
        else
               #some other statement
        fi

        COUNT=0
        for str in ${ipaddr_arr
[*]}
        do
                echo "$str"
                COUNT=$((COUNT+1))
        done

However after the if condition is executed as true, the array does not contain previous values. The statement within if overwrites the array values, without appending the values to it. As in ksh, +A is for appending values to array. However here it is not behaving properly.

I tried with only giving this in if block, still it gives error in ksh-

+A ipaddr_arr $(egrep -v '^#|^::|^$' /etc/hosts |awk '{print $1}')

Anyone have any clues..
thanks in advance for your replies.

I believe both commands( set -A / set +A ) start at element 0:
+A name assigns the parameter list to the elements of name, starting at name[0].
-A name unsets name, then assigns the parameter list to the elements of name starting at name[0].

No, -A option is not working.
What I know +A is to append to array, -A is for creating the array clearing off any previous values.
Any other clues..?
thanks for the reply.

---------- Post updated at 06:25 PM ---------- Previous update was at 11:37 AM ----------

I have found the answer after putting little effort and googling. You can append to the original array with below code snippet-

        set -A ipaddr_arr $(egrep -v '^#|^::|^$' /etc/hosts |awk '{print $1}' | uniq) #hosts ips
        set -A other_arr $(egrep -v '^#|^::|^$' /etc/hosts |awk '{print $1}') 


        if [ "$os" = "solaris" ]
        then
                set -A third_arr $(egrep -v '^#|^::|^$' /etc/hosts |awk '{print $1}')
        else
               #some other statement
        fi
   
       set -A ipaddr_arr ${ipaddr_arr
[*]} ${other_arr
[*]} ${third_arr
[*]}
       #the above code snippet will append all other array values to the first ipaddr_arr

thanks,