Jump to content
UBot Underground

Index Was Outside The Bounds Of The Array Error


Recommended Posts

I have 1 thread that adds items to a table and another that searches the table for specific strings

often 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.

         

Link to post
Share on other sites

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 ?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...