Without looking at that, does it even do what the OP was asking? The OP wasn't really asking about arrays... just dynamic variables.