ViciouS Posted April 10, 2011 Share Posted April 10, 2011 noob question for sure. $var = 0 $var = $var + 1 why is it that its creating 1111111111, instead of 1 2 3 4 5 6 7..... like i want it to? Link to comment Share on other sites More sharing options...
Rogue5099 Posted April 10, 2011 Share Posted April 10, 2011 (edited) $var = 0 For $x = 1 To 10 $var = $var + 1 MsgBox(0, "", $var) Next This works for me??? Edited April 10, 2011 by rogue5099 My projects: Inventory / Mp3 Inventory, Computer Stats Link to comment Share on other sites More sharing options...
MvGulik Posted April 10, 2011 Share Posted April 10, 2011 (edited) This:$var = 0 $var = $var + 1 $var = $var + 1 ;; etcWill NOT produce "11...etc". (not even if you used quoted value's) ... your probably using '&' instead of '+' in your real code.Tip:Show your real code instead of your interpretation of what you think your/the code is doing.(apply's to all, just double, or even triple, for beginners ... or noob's if you like.) Edited April 10, 2011 by iEvKI3gv9Wrkd41u "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
smartee Posted April 10, 2011 Share Posted April 10, 2011 The addition operation is not treated as string concatenation in the AutoIt language. Try these examples$var = 1 $var = $var + 1 MsgBox(64, "Test 1", $var) $var = "String" $var = $var + 1 MsgBox(64, "Test 2", $var) $var = "String" $var = $var + "1" MsgBox(64, "Test 3", $var)If the addition operation is used with strings, then the statement is evaluated using the numerical representation of the expression contained in the string. To see/understand the numeric representation of several string expressions see the Number() function in the help file. 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