error G0058 : Index out of range

Hello,

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

new;
cls;
library pgraph;

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

all=all[198:317,1];

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.

Regards,

Victor

 

1 Answer



0



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:

new;

cls;

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

aptech

1,773

Your Answer

1 Answer

0

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:

new;

cls;

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


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 14 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy