An exception that is thrown because the value of a variable is outside the allowed range
Questions tagged [outofrangeexception]
272 questions
0
votes
0 answers
'std::out_of_range' on substr string
I got a small problem in one of my scripts.
I have a connection to a websocket and the messages are sent by server to my client.
The format is json. I wrote a simple interpreter which is searching for the quotes.
The function header:
ProcessEvent(…

Michael Schneider
- 496
- 1
- 9
- 27
0
votes
1 answer
Argument Out of Range Exception was unhandled
I have below piece of code which runs fine only except when the last index of Combobox is reached it gives the error as mentioned in Title. More details:
Invalid Argument=Value of '17' is not valid for 'SelectedIndex'.
Parameter name:…

DK2014
- 171
- 3
- 20
0
votes
1 answer
why doesn't this django mptt algorithm correctly compute rank? list index out
I am trying to write a simple algorithm to get the 'rank' of a django mptt model. By 'rank' I mean the number of levels of descendents... similar to MPTTModel.get_level() but counting from leaf to root.
My approach is the following:
views.py
def…

David J.
- 1,753
- 13
- 47
- 96
0
votes
0 answers
NSArray index beyond bounds during segue
I have a segue in an iPhone app that crashes if the initiating view controller was reached via a certain path. In those cases when I try to segue to the next screen I get:
*** Terminating app due to uncaught exception 'NSRangeException', reason:…

Kevin Kelly
- 79
- 4
0
votes
2 answers
T-SQL Dealing with Rogue data when Converting to Datetime
I'm pulling data out of a CRM into a reporting system.
Unfortunately the developers of CRM thought it a good idea to store a date as a string, and then not put validation on the field.
I'm trying to do this MAX(Convert(datetime,Action.DateOfAction,…

Ian
- 79
- 1
- 2
0
votes
1 answer
mode, mean, average etc calculator, out of range error?
I get the error:
Line: 23
Char: 4
Subscript out of range: 'numbers'
which is at: if numbers(i) = a then
I have made this in javascript and it works, but I need to convert it.
function info(numbers)
dim numbers2(99999)
numbers3 = ""
dim…

Bradley McInerney
- 1,341
- 4
- 15
- 14
0
votes
4 answers
String conversion in java is throwing array index out of range exception
I have written following code but it is throwing array index out of range exception
String options = "" + args[0];
if (options.toLowerCase().contains("failover"))
{
dataToPass[0]= "failover";
…

Bharath
- 665
- 5
- 12
- 20
0
votes
1 answer
Error: Vector subscript out of range. Line 1201
I am facing the vector subscript out of range erro. I have managed to locate the code that is causing the problem but i dont know how to solve it.
the defined variable types are,
typedef vector v1; //vector string
typedef vector v2;…

Novjean
- 51
- 1
- 5
0
votes
1 answer
VB.NET DateTime out of range exception
In my project I created a label to show a start time and two buttons to adjust it, one is add 15min for each click, the other is subtract 15min. The code is as follows
Label1.text = "04:30 AM"
Private Sub Btn_Click(ByVal sender As System.Object,…

apolloneo
- 169
- 1
- 2
- 18
0
votes
2 answers
Vector out of range- C++
I'm working on a project that requires me to make a game of Hangman in c++. I have most of it working, but I'm stuck at printing out the part of the word guessed correctly each time after the user enters a guess. I've created a class to represent a…

mike
- 1,441
- 2
- 19
- 31
0
votes
2 answers
Error after compiling Java project : Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
I am working on a project for school. The project is a game where the user needs to guess the price of an object. The price is generated randomly. The user has 5 chances to guess it. if he doesnt, th game is over and is asked if he wants to replay…

fredhabsfan
- 13
- 2
0
votes
0 answers
Debug Assertion Failed: string subscript out of range
I'm getting a subscript out of range error.
This is the function where it happens:
//Load Object Function
int loadObejct(const char *fileName)
{
cout<<"soos";
vector coord;
vector vertex;
vector…

user2851631
- 3
- 2
0
votes
1 answer
MySql does not accept C# float.MinValue in float column
I have an application that utilizes NHibernate to handle database functionality. Now I have a table with a column mapped as a float. NHibernate created the table in the MySql database, and I have validated the column to be "FLOAT" as well. NOTE:…

Mike de Klerk
- 11,906
- 8
- 54
- 76
0
votes
1 answer
In what case can this if-statement throw an exception?
Apparently, when my code reaches this if statement, a string subscript out of range exception occurs.
// a is int
// str is std::string
while ( true )
{
// other stuff
if( a == str.size() ) // this line throws an exception
break;
}
In what…

Banderi
- 656
- 3
- 7
- 29
0
votes
2 answers
Python - IndexError: list index out of range - but only in one column of data
I'm trying to read through a CSV file that has a couple thousand rows and 3 columns of data. I'm successfully reading through the first and second column, but when I attempt to read through the third column I get an out of range error. In other…

stoves
- 778
- 1
- 11
- 25