Arrays in ksh

# how to create a array and assign a list of values
set -A fruit apples pears oranges banana
# print the first element in the array
print $fruit[0]
# set a new value to element 1
$fruit[1]=watermelon

# how to get number of elements in the array
$ x[1]=5 x[2]=3 x[3]=6 x[11]=55
$ print ${#x[*]}
4

# Looping through an array
$ for place in ${x[*]}
do
print $place
done
5
3
6
55