t8inevergreen Posted March 11, 2009 Share Posted March 11, 2009 So, we all know that operators like += and &= work in AutoIt... But why does -= throw a syntax error? Link to comment Share on other sites More sharing options...
evilertoaster Posted March 11, 2009 Share Posted March 11, 2009 $a=5 $a-=2 MsgBox(0,"",$a) ;shows 3 No problems here. Link to comment Share on other sites More sharing options...
GEOSoft Posted March 11, 2009 Share Posted March 11, 2009 I don't see a problem. Try this test $i = 1 MsgBox(0, "results", "$i = " & $i) $i += 1 MsgBox(0, "results", "$i = " & $i) $i -= 1 MsgBox(0, "results", "$i = " & $i) George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
t8inevergreen Posted March 11, 2009 Author Share Posted March 11, 2009 Hmm, that does seem to work. In my situation, I was doing this: Global $ArrayMax -= $MultiList[0]-1 Where $ArrayMax and $MultiList[0] are guaranteed numbers. Link to comment Share on other sites More sharing options...
evilertoaster Posted March 11, 2009 Share Posted March 11, 2009 You can't add or subtract something that hasn't been assigned yet... Link to comment Share on other sites More sharing options...
GEOSoft Posted March 11, 2009 Share Posted March 11, 2009 (edited) What do you get with this?Global $ArrayMax -= $MultiList[0]-1 MsgBox(0, "Results", $ArrayMax)Actually that line looks screwy. What were you expecting as a return? What is the size of the array?EDIT: And what evilertoaster said Edited March 11, 2009 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Richard Robertson Posted March 11, 2009 Share Posted March 11, 2009 Dump the global and see if it works. When you redeclare it, it might be wiping the value. Link to comment Share on other sites More sharing options...
t8inevergreen Posted March 12, 2009 Author Share Posted March 12, 2009 Richard Robertson: THANKS! That made it work, and now that I look at it, the Global was unnecessary. And to answer the questions of Evil Toaster and GEOSoft, that line was just an excerpt from a little algo that found duplicates or accidentally included files in a list of daily log files, the line where the syntax error was thrown. -$ArrayMax was the Ubound value of the list array and the maximum for my For loop that compared each list item to the one below it after being sorted by the incredibly useful ArrayNatural UDF. -$MultiList was the array of duplicates that was populated after a single duplicate was found and a While loop was run to find any further duplicates below. Both values are dynamic, but both were declared beforehand and were guaranteed to be numbers. Thanks for your help everyone! 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