Hello all,

I'm hoping there is a way to check to see if the string inside a variable is declared, i suppose it's best described with an example. Note, the below code isnt really for practical purposes, rather i just put it together in 2 mins as a 'simple' example, may have syntax errors etc buy i'm not worried about them at the moment, rather the concept.

 Code:

DIM $variable1, $variable2, $variable3, $variable4, $tempvar, $varcheck, $counter, $varprefix
$variable1 = "abc"
$variable2 = "def"
$variable3 = "ghi"
$variable4 = "jkl"
$varprefix = "$$variable"
$counter = 0
$tempvar = 0
$varcheck = 0
 
Do
	$counter = $counter + 1
	$tempvar = $varprefix + $counter
	"checking to see if the variable (" + $tempvar + ") is declared" ?
	IF isdeclared($tempvar)
		"do Stuff"?
		$varcheck = 1

	ELSE
		$varcheck = 0
	ENDIF	
	

Until $varcheck = 0



Basically what happenes (as it should), is that it is checking to see if the variable '$tempvar' is declared, rather than the name of the variable that it is holding. Is there a way of saying 'check whats inside $tempvar' or somthing that will give that effect?

Thanks in advance

Luke


Edited by lukeod (2008-03-05 12:40 AM)