Hi all,
I am running some codes using GAUSS and getting the following error message:
G0176 : Argument out of range
Could you please advise me the reason and how to deal with it
thanks
S
1 Answer
0
An 'argument' is the input to a function. 'Out of range' means that the input supplied is not in the range of valid inputs. For example, the GAUSS function 'strindx', finds the location of a sub-string inside of another string:
sub_string = "abc";
full_string = "123abc456";
//First character of 'full_string' to check
strt = 1;
//Find index of 'abc' inside of '123abc456'
idx = strindx(full_string, sub_string, strt);
The above code will set 'idx' equal to 4, telling us that 'abc' can be found by looking at the 4th character of '123abc456'. The valid range of 'strt', the first character to check is from 1 to the number of characters in the string. If we change the value of 'strt' from 1 to 0 (which is not in the valid range for that input), like this:
sub_string = "abc";
full_string = "123abc456";
//First character of 'full_string' to check
//Zero is out of range for this input
strt = 0;
//Find index of 'abc' inside of '123abc456'
idx = strindx(full_string, sub_string, strt);
we will get the GAUSS error 'G0176: Argument out of range'.
Your error message should show you the file and line of code that is causing this error for you. If you have trouble, post the line of code that is causing the error and we can help you fix the problem.
Your Answer
1 Answer
An 'argument' is the input to a function. 'Out of range' means that the input supplied is not in the range of valid inputs. For example, the GAUSS function 'strindx', finds the location of a sub-string inside of another string:
sub_string = "abc";
full_string = "123abc456";
//First character of 'full_string' to check
strt = 1;
//Find index of 'abc' inside of '123abc456'
idx = strindx(full_string, sub_string, strt);
The above code will set 'idx' equal to 4, telling us that 'abc' can be found by looking at the 4th character of '123abc456'. The valid range of 'strt', the first character to check is from 1 to the number of characters in the string. If we change the value of 'strt' from 1 to 0 (which is not in the valid range for that input), like this:
sub_string = "abc";
full_string = "123abc456";
//First character of 'full_string' to check
//Zero is out of range for this input
strt = 0;
//Find index of 'abc' inside of '123abc456'
idx = strindx(full_string, sub_string, strt);
we will get the GAUSS error 'G0176: Argument out of range'.
Your error message should show you the file and line of code that is causing this error for you. If you have trouble, post the line of code that is causing the error and we can help you fix the problem.