No i didn't sorry Allen. You were correct, it now works.

Code for anyone interested is:

 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, $cmd
$variable1 = "abc"
$variable2 = "def"
$variable3 = "ghi"
$variable4 = "jkl"
$varprefix = "$variable"
$counter = 0
$tempvar = 0
$varcheck = 1
$cmd = ""
$isdeclared = ""

Do
	$counter = $counter + 1
	$tempvar = $varprefix + $counter
	"checking to see if the variable (" + $tempvar + ") is declared" ?
	$cmd = "$isdeclared = isdeclared(" + $varprefix + $counter + ")"
	EXECUTE($cmd)
	IF $isdeclared = 1
		$varcheck = 1
		"Variable is declared" ?
	ELSE
		$varcheck = 0
		"Variable is not declared, exiting." ?
	ENDIF
	"**********************" ?


Until $varcheck = 0


Thanks for the help guys \:\)

One last question, what is the command to supress the error codes from automatically being displayed on the script? -ie- if i use the "use" command and it is successful, it outputs '0' to the console / text file if being piped. Anyway of preventing this?

Luke


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