error G0058 : Index out of range



I am pretty new to GAUSS and I am stuck on the following command:

library pgraph;

load all[317,1]=c:\lkt\all.txt;


The data is a column vector and I want GAUSS to only access row198 to row317.

What am I doing wrong that gives me the G0058 error message?

Any help would be extremely appreciated.




Tags: asked July 10, 2013

1 Answer


Your lines of code appear correct. I would first verify that the error is occurring on the line that you suspect. Your error should look like this:

C:\gauss13.1\all.gss(5) : error G0058 : Index out of range

The 5 in parentheses is the line on which the error occurred. You can double click this line in your error window to be taken directly to that line in your program.

If it is pointing you to the ‘all = all[198:317,1]‘ line then you need to examine this section more closely.

Try running this file under the debugger to examine all just after it is loaded to see if it looks correct and also to verify that the error is actually occurring on that line. The debugger is really helpful and easy to use, especially in versions 12 and 13.

Or try running each of these lines one by one from the command line:



load all[317,1]=c:\lkt\all.txt;

print "rows of all = " rows(all);

print all;

all = all[198:317];

After entering each print statement at the command line, make sure that the output is what you expect. (Note: you do not have to specify the column when indexing a column vector that is why I put ‘all[198:317]‘ and left out the ‘,1′. Though what you put is also correct.)