I have tried 'Execute' with a few variations, but no cigar \:\( .

First attempt:

 Code:
 
REDIRECTOUTPUT("C:\temp\loopcheck.txt",1)
BREAK ON

DIM $variable1, $variable2, $variable3, $variable4, $tempvar, $varcheck, $counter, $varprefix
$variable1 = "abc"
$variable2 = "def"
$variable3 = "ghi"
$variable4 = "jkl"
$varprefix = "$$variable"
$counter = 0
$tempvar = 0
$varcheck = 1
$a = ""

Do
	$counter = $counter + 1
	$tempvar = $varprefix + $counter
	"checking to see if the variable (" + $tempvar ") is declared" ?
	$a = EXECUTE( isdeclared('$$varprefix + $$counter'))
	" a is... (" + $a + ")" ?
	sleep 0.5
Until $varcheck = 0    ;at the moment it's looping till the cows come home



It spits out a text file (redirectoutput) looking like:

 Code:
checking to see if the variable ($variable1) is declared
0
 a is... (0)
checking to see if the variable ($variable2) is declared
0
 a is... (0)
checking to see if the variable ($variable3) is declared
0
 a is... (0)
checking to see if the variable ($variable4) is declared
0
 a is... (0)
checking to see if the variable ($variable5) is declared
0
 a is... (0)
checking to see if the variable ($variable6) is declared
0
 a is... (0)
checking to see if the variable ($variable7) is declared
0
 a is... (0)
checking to see if the variable ($variable8) is declared
0


I also tried replacing the 'Execute' line with:

 Code:
$a = EXECUTE( isdeclared($tempvar))


Same result.

Also tried:

 Code:
	
$a = EXECUTE( isdeclared('$$tempvar'))



Am i way off course here?

Cheers

Luke


Edited by lukeod (2008-03-05 03:50 AM)