KeitaroUrashimaSan Posted January 26, 2007 Share Posted January 26, 2007 (edited) I started this because the search will not alow the string "variable in variable". What I want to know is if it is possible to call to a variable in another variable. For Example I have several strings in many variables and I want to call to each variable by using a one set variable. I hope this makes sense and that this is the right way to do this. the text in the [] brackets is what I need help with ;variables dim $num dim $first dim $CountLines = 0 ;data $myVariable1 = "string" $myVariable2 = "string" $myVariable3 = "" ;count strings $first = "myVariable" $num = 0 $myVariable = [$first + $num] While $myVariable <> "" $num =+ 1 $countLines =+ 1 $myVariable = [$first + $num] ;I want it to add a number to myVariable and then get the string from myVariable1, then increment that number to 2 and so on WEnd Edited January 26, 2007 by KeitaroUrashimaSan Link to comment Share on other sites More sharing options...
Zedna Posted January 26, 2007 Share Posted January 26, 2007 Look into HelpFile at Eval()Dim $a_b = 12 $s = Eval("a" & "_" & "b") ; $s is set to 12 $s =Eval("c") ; $s = "" and @error = 1 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Valuater Posted January 26, 2007 Share Posted January 26, 2007 maybe.. ;variables dim $num dim $first ;data $myVariable1 = "Dave" $myVariable2 = "John" $myVariable3 = "" ;count strings $first = "myVariable" $num = 0 $myVar = ($first & $num) While $myVar <> "" $num += 1 $myVar = Eval($first & $num );I want it to add a number to myVariable ;and then get the string from myVariable1, then ;increment that number to 2 and so on MsgBox(0x0,"test", $myVar, 2) WEnd 8) Link to comment Share on other sites More sharing options...
KeitaroUrashimaSan Posted January 26, 2007 Author Share Posted January 26, 2007 I added the Eval statement and it works well now thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now