This is from the manual (ENUMVALUE):

$Index = 0
:Loop1
$ValueName = EnumValue("HKEY_CURRENT_USER\Console\Configuration",$Index)
If @ERROR = 0
? "Name found: $ValueName"
$Index = $Index + 1
goto Loop1
endif

I would like to substitute an array for the variable $ValueName e.g.

$ValueNameArray[100]
$Index = 0
:Loop1
$ValueNameArray[$Index] = EnumValue("HKEY_CURRENT_USER\Console\Configuration",$Index)
If @ERROR = 0
? "Name found: $ValueNameArray[$Index]"
$Index = $Index + 1
goto Loop1
endif

This doesn't work (see p.16 of the manual). Neither does:
Execute("$$ValueNameArray[" + $Index + "] = EnumValue.....")

Any suggestions?