trancexx Posted January 23, 2014 Share Posted January 23, 2014 What exactly you see there that it makes you think it's a bug? "Doesn't work" means what? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
JohnOne Posted January 23, 2014 Share Posted January 23, 2014 syntax error, single line if. missing Then. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
trancexx Posted January 23, 2014 Share Posted January 23, 2014 Is this about Au3Check tool, AutoIt language or interpreter issue? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
UEZ Posted January 23, 2014 Share Posted January 23, 2014 (edited) Using this code I'm getting an error message:#AutoIt3Wrapper_Run_AU3Check=n $a = 2 $b = 1 If ($a > 1) Then ($b *= -1) ConsoleWrite($b & @LF)"C:test07.au3" (4) : ==> Missing right bracket ')' in expression.:If ($a > 1) Then ($b *= -1)If ($a > 1) Then ^ ERRORFor $a = 1 it works w/o an em.Br,UEZ Edited January 23, 2014 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
bogQ Posted January 23, 2014 Share Posted January 23, 2014 (edited) it consider it like func i guess func Then($b *= -1) endfunc edited:tupo Edited January 23, 2014 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
trancexx Posted January 23, 2014 Share Posted January 23, 2014 That is correct error message. What confuses you, I guess, is that the error is detected at runtime. Interpreter will check the syntax of your code to a certain degree before it starts executing it, but obviously it wouldn't check whether you are trying to sell compound operators under something else. For case when $a = 1 there are no run-time errors - because there are no run-time errors. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
UEZ Posted January 23, 2014 Share Posted January 23, 2014 For me the stuff in brackets will be executed first then outside the brackets. I would expect that for If ($a > 1) Then ($b *= -1) $b will be set to -1 as it will be done without brackets. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
bogQ Posted January 23, 2014 Share Posted January 23, 2014 (edited) your calling func Then() starting with If with no Then after func and Then cant be func name conflict of interest i guess Edited January 23, 2014 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
UEZ Posted January 23, 2014 Share Posted January 23, 2014 your calling func Then() starting with If with no Then after func and Then cant be func name conflict of interest i guess Which function? Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
bogQ Posted January 23, 2014 Share Posted January 23, 2014 Function named "Then()" that cant exsist coz Then cant be Func. TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
water Posted January 23, 2014 Share Posted January 23, 2014 (edited) For me the stuff in brackets will be executed first then outside the brackets.I would expect that for If ($a > 1) Then ($b *= -1) $b will be set to -1 as it will be done without brackets.My 2 cents worth:This sentence in the help file for Operators describes what you see: "You can use brackets to force a part of the expression to be evaluated first."So first the expressions in the brackets are evaluated. Means($a > 1) evaluates to True($b *= -1) returns the error If you try:If ($a > 1) Then ($b = -1)$b still will not be -1 because the expression in brackets is not an assignment but a comparison. Edited January 23, 2014 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
UEZ Posted January 23, 2014 Share Posted January 23, 2014 (edited) If <expression> Then statementWhen I created this code >here I wrote accidently If ($x > 200) Then ($iDir *= -1) which caused the error.I just asked my self whether I've some logical problem to undersand why the statement in brackets is not executed as without brackets...Br,UEZ Edited January 23, 2014 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
AZJIO Posted January 24, 2014 Share Posted January 24, 2014 _GUICtrlListView_CreateArray - useful thing to add.http://autoit-script.ru/index.php?topic=12724.10 My other projects or all Link to comment Share on other sites More sharing options...
trancexx Posted January 24, 2014 Share Posted January 24, 2014 When I created this code >here I wrote accidently If ($x > 200) Then ($iDir *= -1) which caused the error. I just asked my self whether I've some logical problem to undersand why the statement in brackets is not executed as without brackets... Br, UEZ Compound assignment operators modify the value of a variable by performing an operation on it, they don't return value. When you put expression in parentheses you ask for its value: $x = 3 $b = 2 ($b = -1) ConsoleWrite($b & @CRLF) ...That code is equivalent to: $x = 3 $b = 2 (False) ConsoleWrite($b & @CRLF) Your $iDir *= -1 doesn't yield value and therefore can't be enclosed in parentheses. Some languages work differently. czardas and water 2 ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Richard Robertson Posted January 26, 2014 Share Posted January 26, 2014 I thought everyone already understood that we can't wrap statements in parenthesis? Link to comment Share on other sites More sharing options...
water Posted January 26, 2014 Share Posted January 26, 2014 Obviously not My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Inververs Posted January 26, 2014 Share Posted January 26, 2014 I think AutoIT needs explicit assignment operator, such as := or === Link to comment Share on other sites More sharing options...
JohnOne Posted January 27, 2014 Share Posted January 27, 2014 I think AutoIT needs explicit assignment operator, such as := or === Don't be shy, explain why you think what you do. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Richard Robertson Posted January 27, 2014 Share Posted January 27, 2014 Many languages allow assignment mid expression, however assignment takes = and equality comparison takes == in those languages. Link to comment Share on other sites More sharing options...
AZJIO Posted January 27, 2014 Share Posted January 27, 2014 _GUICtrlMenu_EnableMenuItem - Error return value. Read here - http://autoit-script.ru/index.php/topic,15858.0/topicseen.html My other projects or all 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