Cheers Glenn.

I'm very, very close!

My Code:

 Code:
$RC=setoption("NoVarsinstrings","on")
$RC=setoption("NoMacrosinstrings","on")

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


BREAK ON

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

Do
	$counter = $counter + 1
	$tempvar = $varprefix + $counter
	"checking to see if the variable (" + $tempvar + ") is declared" ?
	$cmd = "isdeclared(" + $varprefix + $counter + ")"
	"CMD is: " + $cmd  ?
	"Error Before EXECUTE is " + @error ?
	$a = EXECUTE($cmd)
	"Error Code after Execute is: (" + @ERROR + ")" ?
	"Execute leave code is:(" + $a + ")" ?
	"**********************" ?

sleep 0.2

Until $varcheck = 0



Returns a text file looking like:

 Code:
0checking to see if the variable ($variable1) is declared
CMD is: isdeclared($variable1)
Error Before EXECUTE is 0
1Error Code after Execute is: (0)
Execute leave code is:(0)
**********************
checking to see if the variable ($variable2) is declared
CMD is: isdeclared($variable2)
Error Before EXECUTE is 0
1Error Code after Execute is: (0)
Execute leave code is:(0)
**********************
checking to see if the variable ($variable3) is declared
CMD is: isdeclared($variable3)
Error Before EXECUTE is 0
1Error Code after Execute is: (0)
Execute leave code is:(0)
**********************
checking to see if the variable ($variable4) is declared
CMD is: isdeclared($variable4)
Error Before EXECUTE is 0
1Error Code after Execute is: (0)
Execute leave code is:(0)
**********************
checking to see if the variable ($variable5) is declared
CMD is: isdeclared($variable5)
Error Before EXECUTE is 0
0Error Code after Execute is: (0)
Execute leave code is:(0)
**********************
checking to see if the variable ($variable6) is declared
CMD is: isdeclared($variable6)
Error Before EXECUTE is 0
0Error Code after Execute is: (0)
Execute leave code is:(0)
**********************


Notice that before the line (text file) "Error after Execute is:" it returns a 1 if the variable exists, and a 0 if it dosnt. This is the variable i'm chasing, except i dont know how to use it!! @error and $a dont appear to be this rogue character. Any ideas on what this variable is and how i could then use it in an IF THEN ELSE statement?

Thanks for the help so far \:\)

Luke