genius257 Posted May 13 Share Posted May 13 (edited) So i do a lot of unusual stuff with AutoIt, and find weird syntax as a result... I'll start off with this: consolewrite("test"&Chr(65)Chr(65)Chr(65)&&&@CRLF); testAAA Maybe it is an intentional feature of AutoIt, but i believe it is just a weird glitch in the parser. Meaning any string concatenation can be moved to the end of string: $x = 'a'"b"'c'&& ConsoleWrite($x & @CRLF) Tested with 3.3.16.1 Edited May 23 by genius257 My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser Link to comment Share on other sites More sharing options...
Werty Posted May 14 Share Posted May 14 (edited) Weird $string = Chr(65)Chr(85)&1-+++-1-+++-1&&@crlf consolewrite($String) Edited May 14 by Werty jchd 1 Some guy's script + some other guy's script = my script! Link to comment Share on other sites More sharing options...
Andreik Posted May 14 Share Posted May 14 5 hours ago, Werty said: Weird $string = Chr(65)Chr(85)&1-+++-1-+++-1&&@crlf consolewrite($String) Is this working with the last AutoIt version? What about SciTE? Doesn't throw any compile or runtime error? Link to comment Share on other sites More sharing options...
Werty Posted May 14 Share Posted May 14 (edited) 10 minutes ago, Andreik said: Is this working with the last AutoIt version? Yes, 3.3.16.1, outputs "AU3" in the console. 10 minutes ago, Andreik said: What about SciTE? Doesn't throw any compile or runtime error? SciTE Lite is silent, dont know about full SciTE. Edited May 14 by Werty Andreik 1 Some guy's script + some other guy's script = my script! Link to comment Share on other sites More sharing options...
Nine Posted May 14 Share Posted May 14 If running from full Scite, you need to add : #AutoIt3Wrapper_Run_Au3Check=n Andreik 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Werty Posted May 14 Share Posted May 14 (edited) The "1-+++-1-+++-1" part has been like that for years, Try various combinations of "---++---------+----+--+" or whatever with some numbers. The "Chr()Chr()&&" part I didnt know about. Edited May 14 by Werty Some guy's script + some other guy's script = my script! Link to comment Share on other sites More sharing options...
donnyh13 Posted May 22 Share Posted May 22 Does this count? I at least haven't seen it listed in the help file anyway. (Maybe missed it) Local $bTest $bTest = ConsoleWrite("Hi!" & @CRLF) = 5 ConsoleWrite($bTest & @CRLF) LibreOffice UDF ; Scite4AutoIt Spell-Checker Using LibreOffice Spoiler "Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions." Link to comment Share on other sites More sharing options...
argumentum Posted May 23 Share Posted May 23 2 hours ago, donnyh13 said: (Maybe missed it) Return Value: The amount of data written. So ( 5 = 5 ) is True. donnyh13 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
genius257 Posted May 23 Author Share Posted May 23 (edited) Here is another: $x = 1 ? 1 : 0 : 0 : 0 : 0 : 0 Au3Check complains, but it works at runtime The ternary expression will still work as expected. Tested with 3.3.16.1 Edited May 23 by genius257 My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser Link to comment Share on other sites More sharing options...
genius257 Posted May 23 Author Share Posted May 23 And here is an undocumented feature i personally love ❤️ $t = DllStructCreate("INT a;INT b;INT c[3];") ; DllStruct values can used via dot notation $t.a = 123 ConsoleWrite($t.a & @CRLF) ; But i recently discovered this also applies to indexed elements: ConsoleWrite($t.c(2) & @CRLF) $t.c(2) = 123 ConsoleWrite($t.c(2) & @CRLF) Gianni 1 My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser Link to comment Share on other sites More sharing options...
genius257 Posted May 23 Author Share Posted May 23 (edited) And a silly one: Keywords like Null and Default MUST be followed with a space, when followed by operators like & and + $x = Null+1; ConsoleWrite($x&@CRLF) test.au3 (76) : ==> Missing separator character after keyword.: $x = Null+1 $x = Null^ ERROR Au3Check will not detect this error. Tested with 3.3.16.1 Edited May 23 by genius257 Andreik 1 My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser Link to comment Share on other sites More sharing options...
Andreik Posted May 23 Share Posted May 23 29 minutes ago, genius257 said: And a silly one I usually use spaces between operators keywords, etc, for a better reading, yet this one is ridiculous. Link to comment Share on other sites More sharing options...
MattyD Posted May 23 Share Posted May 23 2 hours ago, genius257 said: And here is an undocumented feature i personally love ❤️ I could be mis-remembering, but I'm sure this was on the chopping block at some point years ago... Can't find the thread now, but I think it was along the lines of reserving dot notation for object datatypes. Link to comment Share on other sites More sharing options...
Andreik Posted May 23 Share Posted May 23 I remember too that dot notation is not encouraged so it doesn't appear anywhere in the help file, yet it's used by many of us. Link to comment Share on other sites More sharing options...
Nine Posted May 23 Share Posted May 23 3 hours ago, genius257 said: And here is an undocumented feature i personally love ❤️ $t = DllStructCreate("INT a;INT b;INT c[3];") ; DllStruct values can used via dot notation $t.a = 123 ConsoleWrite($t.a & @CRLF) ; But i recently discovered this also applies to indexed elements: ConsoleWrite($t.c(2) & @CRLF) $t.c(2) = 123 ConsoleWrite($t.c(2) & @CRLF) There is also an undocumented bug about this notation that one must be aware of : $t.c(2) = 123 ConsoleWrite($t.c(2) & @CRLF) $i = 2 $t.c($i) = 321 ; does not work ConsoleWrite($t.c(2) & @CRLF) $t.c(($i)) = 321 ; now works ConsoleWrite($t.c(2) & @CRLF) genius257 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
donnyh13 Posted May 23 Share Posted May 23 13 hours ago, argumentum said: Return Value: The amount of data written. Thanks, I do understand that, but what I meant is I haven't seen any documentation on comparing two items and it returning a Boolean directly to a variable like that, without a If/Ternary. Perhaps it's just coding common-knowledge that I missed somewhere. LibreOffice UDF ; Scite4AutoIt Spell-Checker Using LibreOffice Spoiler "Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions." 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