636C65616E Posted January 21, 2021 Author Share Posted January 21, 2021 (edited) hmmm, what i see now is a bit weird changing the value in the array must not change his address, and futhermore as the references in $a and $b (the array address) have not changed, they should remain equal like the abc of pointers, i can't see why they would not implement it this way ... Edited January 21, 2021 by 636C65616E Link to comment Share on other sites More sharing options...
JockoDundee Posted January 21, 2021 Share Posted January 21, 2021 6 hours ago, Nine said: Nope. Should be false as new memory address is assign to the array. So to be clear, you agree that $a and $b have the same memory location right after: Local $a = $b but have different memory locations right after: $b[0]=1 ? Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
Nine Posted January 21, 2021 Share Posted January 21, 2021 @JockoDundee Yes. See my previous post. “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...
Nine Posted January 21, 2021 Share Posted January 21, 2021 1 hour ago, 636C65616E said: what i see now is a bit weird I think it would be even more weird if after setting $a[0] = 9 to be still equals to $b. That wouldn't make any sense... “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...
636C65616E Posted January 21, 2021 Author Share Posted January 21, 2021 (edited) there's a difference between $a[0] and $a one is a scalar, the other is a ptr (or something similar for the VM) ofc AutoIt doesn't handle array as C type stuff, but it needs memory addressing in the end, so this kind of scheme must exists Edited January 21, 2021 by 636C65616E Link to comment Share on other sites More sharing options...
jchd Posted January 21, 2021 Share Posted January 21, 2021 Isn't this called copy on write? This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
JockoDundee Posted January 21, 2021 Share Posted January 21, 2021 1 hour ago, Nine said: @JockoDundee Yes. See my previous post. I have, I was just looking to clarify. What I don't agree with is this: Quote A patch has been sent by the devs for approval. If accepted, comparing $b = $a will return True because memory address would be the same. The danger is that such a change would be script breaking, since, rightly or wrongly, there is no doubt code out there that depends on the current behavior that would no longer work. Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
Nine Posted January 21, 2021 Share Posted January 21, 2021 2 hours ago, JockoDundee said: The danger is that such a change would be script breaking, since, rightly or wrongly, there is no doubt code out there that depends on the current behavior that would no longer work. What are you talking about ? Comparing arrays (with = op) was always returning the same result (False) whatever the arrays was, whatever you were comparing. Unless you were using == which everything was True. How a more intelligent comparaison would be script breaking ? Nobody was using intentionally : Local $a[] = [1,2,3] Local $b = $a While Not ($b = $a) WEnd Instead of : While True WEnd If someone was doing it, well I suppose it is time to change their scripts because it was not making much sense... “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...
JockoDundee Posted January 22, 2021 Share Posted January 22, 2021 (edited) 56 minutes ago, Nine said: Nobody was using intentionally : Local $a[] = [1,2,3] Local $b = $a While Not ($b = $a) WEnd True, especially when a more economical option was available: Local $a=[0] Do Until $a = $a Edited January 22, 2021 by JockoDundee Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
markyrocks Posted January 24, 2021 Share Posted January 24, 2021 (edited) I whipped together this example of a custom data type in autoit. It offers the ability to compare 2 custom arrays bc its just a pointer comparison. it does offer the ability to create an alias of another. It is probably correct that this wont offer much in terms of performance gains, simply due to the fact that to dereference any pointer a struct has to be created which is just bananas(that includes any read or write operation). I'm honestly considering something like this but using a helper c++ program that would allow me to dereference without jumping though all these hoops. That and any memory operation is going to be 10x faster in c++ compared to autoit anyways so offloading all the heavy lifting would have serious speed benefits. asdfwefa.au3 Edited January 24, 2021 by markyrocks Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" 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