genius257 Posted May 13, 2024 Posted May 13, 2024 (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, 2024 by genius257 To show your appreciation My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser
Werty Posted May 14, 2024 Posted May 14, 2024 (edited) Weird $string = Chr(65)Chr(85)&1-+++-1-+++-1&&@crlf consolewrite($String) Edited May 14, 2024 by Werty jchd 1 Some guy's script + some other guy's script = my script!
Andreik Posted May 14, 2024 Posted May 14, 2024 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?
Werty Posted May 14, 2024 Posted May 14, 2024 (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, 2024 by Werty Andreik 1 Some guy's script + some other guy's script = my script!
Nine Posted May 14, 2024 Posted May 14, 2024 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) Debug Messages Monitor UDF Screen Scraping Multi-Threading Made Easy
Werty Posted May 14, 2024 Posted May 14, 2024 (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, 2024 by Werty Some guy's script + some other guy's script = my script!
donnyh13 Posted May 22, 2024 Posted May 22, 2024 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."
argumentum Posted May 23, 2024 Posted May 23, 2024 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.
genius257 Posted May 23, 2024 Author Posted May 23, 2024 (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, 2024 by genius257 To show your appreciation My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser
genius257 Posted May 23, 2024 Author Posted May 23, 2024 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 To show your appreciation My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser
genius257 Posted May 23, 2024 Author Posted May 23, 2024 (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, 2024 by genius257 Andreik 1 To show your appreciation My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser
Andreik Posted May 23, 2024 Posted May 23, 2024 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.
MattyD Posted May 23, 2024 Posted May 23, 2024 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.
Andreik Posted May 23, 2024 Posted May 23, 2024 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.
Nine Posted May 23, 2024 Posted May 23, 2024 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) Debug Messages Monitor UDF Screen Scraping Multi-Threading Made Easy
donnyh13 Posted May 23, 2024 Posted May 23, 2024 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."
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