Questions tagged [outofrangeexception]

An exception that is thrown because the value of a variable is outside the allowed range

272 questions
2
votes
1 answer

Having problems comparing elements from two different lists

I'm currently trying to create a Typing Test program. I'm having issues comparing the elements inside these two lists list1 (10 random words) and list2 (10 user inputs). Here is the error message that I get: ArgumentOutOfRangeException was…
2
votes
2 answers

What is the defined behavior of std::string::erase() with a pos of string::npos?

What does the C++11 standard specify for the behavior of the string& erase (size_t pos = 0, size_t len = npos); member function when the pos argument is passed as string::npos? I would think it should erase nothing, but perhaps it throws an…
WilliamKF
  • 41,123
  • 68
  • 193
  • 295
2
votes
2 answers

Threads and IndexOutOfRange exception

As you can clearly see the highest index of the args[] is 2, however the iterator somehow gets to 3. Explanation? Edit: The commented Thread.Sleep magically fixes the problem.
TheDespite
  • 333
  • 1
  • 2
  • 11
2
votes
1 answer

MYSQL query minus operator not working

Looked up of all questions about error with minus operator in MYSQL and can't find solution. all given solutions not working. i`m trying to get difference between Units In Stock and Units On Order and my query like this: $sql = "SELECT …
Victorino
  • 1,623
  • 11
  • 22
2
votes
2 answers

DataTableReader.GetValue(int) is throwing ArguementOutOfRangeException

In a section of my code I use a DataTable and a DataTableReader to get information from my SQLite database and add it to a list. When the program gets to the reader.GetValue line the program throws an ArgumentOutOfRangeException. As far as I've been…
2
votes
1 answer

pointerIndex out of Range multitouch

At first, i really know there are more than one post about it, but non helped me fixing the bug/misstake. I am sorry if its a repost and hope you guys can help me getting rid of this bug. 11-28 17:36:36.110: W/dalvikvm(8380): threadid=1: thread…
bemeyer
  • 6,154
  • 4
  • 36
  • 86
2
votes
2 answers

ASP If Statement if Split() is empty as I get Subscript out of range: '[number: 1]'

I have a single form field that asks for "Full Name" when the user signs up. I want to then split that string into first name and then surname. I can get that working with the following code: <% If Request.Form("user[username]") <> "" Then …
Nick Green
  • 428
  • 3
  • 8
  • 18
2
votes
6 answers

C# ArgumentOutOfRangeException parameter intellisense

When I'm writting: throw new ArgumentOutOfRangeException("") Placing the caret between the quotes, and pressing Ctrl+Space to open up intellisense actually does something! The strange and beautiful thing that dazzles me is that it actually suggests…
SimpleVar
  • 14,044
  • 4
  • 38
  • 60
2
votes
2 answers

Problems with C# lists, and ArgumentOutOfRangeException

I am in the process of making a farming/tower defense game and I am very new at programming. I seem to have a major problem with using Lists<> or arrays in XNA. I cannot get it to return the index that I want from the list. The main question is…
1
vote
2 answers

Please what's causing this "Index was out of range Must be non-negative... error"?

Please can someone really tell me what's wrong with this code that I'm having this error: System.ArgumentOutOfRangeException was caught Message=Index was out of range. Must be non-negative and less than the size of the collection. Parameter name:…
Charles
  • 491
  • 3
  • 9
  • 20
1
vote
2 answers

select_item=tree_frame.selection()[0] IndexError: tuple index out of range error coming in python Tkinter

I am having problems select_item = tree_frame.selection()[0] IndexError: tuple index out of range I have an employee table, I am trying to delete a record from the table, but when I select a record for 1st time it is working fine but while I'm…
1
vote
1 answer

Check null/empty at multiple levels using question mark operator c#

Consider I have the following class class Dummy { List list; } class DummyObj { string A; int B; } I have a Helper Class which takes in an object of type Dummy and returns the value of A present at index 0 of list. I'm trying…
1
vote
0 answers

Telerik: Selection out of range

I use to get the following exception once in a while. Can anyone help me out with this like what leads to this exception. Looks like a RadComboBox exception. Everything looks fine but still sometimes get this error Message: Message: Selection out of…
1
vote
1 answer

C++ vector::_M_range_check error while trying to use pbPlots

While trying to understand the pbPlots library i wrote a piece of code: #include "pbPlots.hpp" #include "supportLib.hpp" #include #include using namespace std; void print(std::vector const &input) { for (int i = 0; i…
Rui Coito
  • 379
  • 1
  • 3
  • 6
1
vote
2 answers

How to prevent the Scrollbar out of range?

I use the code procedure TMyCanvas.RichEditChange(Sender: TObject); var ScrollInfo: TScrollInfo; begin FillChar(ScrollInfo, SizeOF(ScrollInfo), 0); ScrollInfo.cbSize := SizeOf(ScrollInfo); ScrollInfo.fMask := SIF_RANGE or SIF_PAGE or…
XBasic3000
  • 3,418
  • 5
  • 46
  • 91
1 2
3
18 19