problem with set command in korn shell

I have to copy an array to a temp variable and back after doing some functions. I am trying to see if it is possible to do without while loops.My closest try was

set -A temp ${THE_ARRAY[*]}

# restore array after some actions
set -A THE_ARRAY ${temp[*]}

The problem with above is that, the new restored array starts from 0 (subscript), instead of 1. This is very bad for my rest of the script, does anyone know a solution to this problem

Not sure that I understand what you want, but try this:

set -A THE_ARRAY garbage ${temp[*]}
unset THE_ARRAY[0]