alexx Posted February 27, 2007 Share Posted February 27, 2007 Can you make a new variable each time something happens ... e.g. first $1, then $2, then $3... etc ? Link to comment Share on other sites More sharing options...
jessegk Posted February 27, 2007 Share Posted February 27, 2007 Can you make a new variable each time something happens ... e.g. first $1, then $2, then $3... etc ?I am not that great at autoit but I might be able to help since there are not very man people on. Could you rephrase the question? Do you want to add to the variable and make it bigger? Link to comment Share on other sites More sharing options...
alexx Posted February 27, 2007 Author Share Posted February 27, 2007 No thats not it I'm trying to record multiple bits of information at different times and I need a new variable each time to keep it... Bleh I cant explain it Link to comment Share on other sites More sharing options...
MHz Posted February 27, 2007 Share Posted February 27, 2007 (edited) You may want to use Assign() to create your variables and then use Eval() to use them. Small example ; Create variables For $i = 1 To 3 Assign('var' & $i, $i * 20) Next ; Display variables For $i = 1 To 3 MsgBox(0, IsDeclared('var' & $i), Eval('var' & $i)) Next Edit: But using an array could be easier if suitable. Edited February 27, 2007 by MHz Link to comment Share on other sites More sharing options...
alexx Posted February 27, 2007 Author Share Posted February 27, 2007 YAY I can use arrays now! took me a while to get it right but it was exactly what I wanted! (I tried assign and eval but I still dont understand them) but I have a question... when starting the array I used Dim $Array[1] like in the example but why do you have to include the [1] to use the array? It's annoying having a first blank Link to comment Share on other sites More sharing options...
MHz Posted February 27, 2007 Share Posted February 27, 2007 An array is like a box of a dozen eggs. The box is the array in total of 12 elements ($box[11]). To get your fingers on the first egg, then you need to following a rule governed by using a number as an index. So you would use $box[0] to access the first egg, $box[1] for the second and so on. Arrays in AutoIt start from an index of 0.Look here for more help with arrays.http://www.autoitscript.com/wiki/index.php?title=Arrays Link to comment Share on other sites More sharing options...
/dev/null Posted February 27, 2007 Share Posted February 27, 2007 YAY I can use arrays now! took me a while to get it right but it was exactly what I wanted! (I tried assign and eval but I still dont understand them) but I have a question... when starting the array I used Dim $Array[1] like in the example but why do you have to include the [1] to use the array? It's annoying having a first blank Have a look at the _Array* functions (help file). #include <Array.au3> $avArray = _ArrayCreate("Jim Bob") _ArrayDisplay( $avArray, "Array" ) _ArrayAdd( $avArray,"Marry Ellen") _ArrayDisplay( $avArray, "Updated Array" ) __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * 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