That seems like an overly complicated way to store many pieces of data in a string. Leaving the Aname label aside for the moment, this is a much simpler way to do it:
DEFLNG A-Z
TYPE t
s AS STRING
END TYPE
DIM v AS t
FOR i = 10 TO 0 STEP -1
set v.s, i, i ^ 2
NEXT i
FOR i = 0 TO 10
PRINT get(v.s, i)
NEXT i
SUB set (array$, index, value&)
element_size = LEN(value)
IF LEN(array$) < element_size * (index + 1) THEN
array$ = array$ + STRING$(element_size * (index + 1) - LEN(array$), CHR$(0))
END IF
MID$(array$, index * element_size + 1) = _MK$(LONG, value)
END SUB
FUNCTION get& (array$, index)
get = _CV(LONG, MID$(array$, index * LEN(get) + 1, LEN(get)))
END FUNCTION
(Change the &s and the 'LONG's to whatever data type you want).
You could rewrite this to use _MEM too, but I don't consider any speed gain to be worth the extra complexity of manual memory management, especially once you start building arrays of UDTs or passing the UDT around as an intermediate value.