Page 1 of 1 1
Topic Options
#49065 - 2000-02-24 11:39 PM Use of arrays
Anonymous
Unregistered


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?

Top
#49066 - 2000-02-29 11:45 AM Re: Use of arrays
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX

just a few syntax errors


DIM $ValueNameArray[100] ;You need to declare array's before you use them.
$Index = 0
:Loop1
$ValueNameArray[$Index] = EnumValue("HKEY_CURRENT_USER\Console\Configuration",$Index)
If @ERROR = 0
? "Name found:" + $ValueNameArray[$Index] ;you can't put array's in a string.
$Index = $Index + 1
goto Loop1
endif



Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 774 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.049 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org