I know I can use something like either IF or SELECT, but is there another (better) way to enumerate the current values and then create and populate the next available one?

i.e.

HKLM\Software\MyCompnayStuff
1 SM-FILE1
2 SM-DATA
3 SM-HARDWARE
4
5 SOFTWARE
6 PHONE

In the example above I would want to find that the string value of 6 was already in use and now the number 7 is the next available value that I should add and populate. Notice that 4 is empty so using <>"" test would not be valid alone.

I'm using KiXtart v4.02 currently, soon to be 4.11

Ok, reading manual I found this. I'll work on this idea. I never noticed this command before.

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



[ 30. August 2002, 02:39: Message edited by: NTDOC ]