How to loop through array who's name is entered in command line?

Say I have a ksh program called test.ksh which has several defined arrays inside it such as array1,array2,array3...These arrays contain strings.

I also have a method in the program:

for x in $1
do
....(#do something)
done

So, when the user enteres: ./test.ksh array1, I want to loop thruogh the contents of array1 using my for loop. However, with the for loop I have, the program takes the user's entry as a string and tries to perform the actions on that. How do I make it so the program will look for the array which the user enters?

The code inside the for loop

temp=${x}[@] 
echo ${!temp}

What do you mean? Put those lines after "do" ?

I tried that and I get these errors:

test.ksh[37]: temp:  not found
test.ksh[38]: ${!temp}: bad substitution

The code inside the for loop
This is a bash solution.