What I mean by 'it doesn't sound like your array will be growing very large' is 'low thousands of items'.
ROTATE ARRAY is actually unnecessary in this instance - it's far too heavy-weight for what you really want, which is SWAP ARRAY ITEMS.
If you have a variable alongside your array that records the top item, then deleting an item from the array is equivalent to swapping that item with the top item, then decreasing the variable by 1 - that's faster than deleting from the array, or rotating everything down by 1.
Inserting an item then becomes an increment of the variable, then checking if the variable is beyond the end of the array. If this is the case, you then expand the array by a number of items (ARRAY INSERT AT BOTTOM array(), number_of_items). The variable now points at your newly allocated item which you can populate as needed.
You could also avoid the variable, as arrays (in their guise a lists) also have a 'current pointer'.
I don't know what this technique is called by everyone else, but I label it a 'combined in-use/free list'. I'll see if I can locate some example code.
[edit]
Example code here (using the 'current pointer'):
type MyType_T
Key as integer
Data1 as integer
Data2 as integer
endtype
global dim MyArray() as MyType_t
set array index MyArray(), -1
PrintArray(0)
Add_MyArray(123, 0, 0)
PrintArray(90)
Add_MyArray(456, 0, 0)
PrintArray(180)
Remove_MyArray(0)
PrintArray(270)
Add_MyArray(789, 0, 0)
Add_MyArray(1, 0, 0)
Add_MyArray(2, 0, 0)
Add_MyArray(3, 0, 0)
PrintArray(360)
wait key
end
function Add_MyArray(Key as integer, Data1 as integer, Data2 as integer)
next array index MyArray()
if array index valid( MyArray() ) = 0 then array insert at bottom MyArray(), 2 ` Grow in steps of 2 - tunable
MyArray().Key = Key
MyArray().Data1 = Data1
MyArray().Data2 = Data2
endfunction
function Remove_MyArray(Index as integer)
swap array items MyArray(), Index, get array index( MyArray() )
previous array index MyArray()
endfunction
function PrintArray(x as integer)
local i as integer
local ListTop as integer
local ArrayTop as integer
local y as integer
y = 0
text x, y, "Size: " + str$( array count( MyArray() ) )
inc y, 15
text x, y, "Index: " + str$( get array index( MyArray() ) )
inc y, 30
` Show the valid items in the array
ListTop = get array index( MyArray() )
for i = 0 to ListTop
text x, y, "+ " + str$(i) + " : " + str$( MyArray(i).Key )
inc y, 15
next
` Show the rest (if any)
ArrayTop = array count( MyArray() )
for i = ListTop + 1 to ArrayTop
text x, y, "- " + str$(i) + " : " + str$( MyArray(i).Key )
inc y, 15
next
endfunction