To put the codes into an array, you need to know how many there are.
Where do you store the Position records that are returned by readPosition? Can the size of that be used to create the array and...