ed08724 6 Posted July 7, 2017 Report Share Posted July 7, 2017 I have 1 thread that adds items to a table and another that searches the table for specific stringsoften the search thread gives an error "index was outside the bounds of the array"I assume this is because the thread adding a row is causing the table to be unavailable for a period of time.I tried setting a variable before and then clearing it after the operation adding the row then checking that variable in the search thread before doing the search but it still gives the error. add thread:increment(#barow)set(#tablelock,$true,"Global")set table cell(&babooks,#barow,0,"")set(#tablelock,$false,"Global") search thread:loop while(#tablelock) { wait(.1)}set(#findprice,$plugin function("TableCommands.dll", "$table search", &babooks, "processingprice123x", "Row Index"),"Global") any ideas how to solve this? Thanks. Quote Link to post Share on other sites
kill3rbko 12 Posted July 7, 2017 Report Share Posted July 7, 2017 Are you sure while setting #findprice the "add thread" is modifying the table ?May be the same principe with a variable #findingprice to block add thread while setting #findprice ? Quote Link to post Share on other sites
ed08724 6 Posted July 7, 2017 Author Report Share Posted July 7, 2017 not sure what you mean by first statement.the second sounds like a good idea. I will test that.Thanks,Ed Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.