help with reading command line into array

        set -A title
        set -A author
        count=1
        index=0
        while [ $count -le $numarg ]
        do
                read -A ${title[$index]}?"Booktitle: "
                read -A ${author[$index]}?"Author(s): "
                (( count = count + 1 ))
                (( index = index + 1 ))
        done

Hi this is my code and i am trying to use this loop to prompt the user using the read ksh command and then store the response they give into each element of the array but when i try and run the script i get the error ... that read : bad options. I don't really understand how to create arrays in ksh yet so maybe iv done that wrong? any help would be appreciciated..

When you assign to an array element, you don't need the ${..} construct. It also seems that the -A option causes issues when assigning to an array element. When I tested it I needed to use the syntax below to have the response saved if it contained blanks:

        set -A title
        set -A author
        count=1
        index=0
        while [ $count -le $numarg ]
        do
                read  title[$index]?"Booktitle: "
                read author[$index]?"Author(s): "
                (( count = count + 1 ))
                (( index = index + 1 ))
        done