Open /* */ comment G0562 : 'endif'

Good Day!,

I am trying to run some code but got stuck at this portion with the error code:

Open /* */ comment G0562 : 'endif'

Any guidance to solve the problem please.

regards,

ozey

if (p1==0)and(p2==0);
    cris=data[1:rows(data)-h,2];
    x=x~cris;
elseif p1>p2;
    cris=data[(p1+2):rows(data)-h,2];
    x=x~cris;
elseif p1<p2;
    cris=data[(p2+1):rows(data)-h,2];
    x=x~cris;
elseif (p1==p2)and(p2/=0);
    cris=data[(p1+2):rows(data)-h,2];
    x=x~cris;
endif;

2 Answers



0



Hello Ozey,

The error

Open /&ast; &ast;/ comment G0562 : 'endif'

indicates that you have a C-style comment (/&ast; &ast;/) right after an endif statement.

If we add a little code to define the neede variables, we can run your code snippet without problem like this:

// Assign variables so code snippet will run
p1 = 0;
p2 = 0;
h = 1;
data = rndn(10,2);
x = {};

if (p1==0)and(p2==0);
    cris=data[1:rows(data)-h,2];
    x=x~cris;
elseif p1>p2;
    cris=data[(p1+2):rows(data)-h,2];
    x=x~cris;
elseif p1<p2;
    cris=data[(p2+1):rows(data)-h,2];
    x=x~cris;
elseif (p1==p2)and(p2/=0);
    cris=data[(p1+2):rows(data)-h,2];
    x=x~cris;
endif;

However, if we add an open C-style comment after the last line like this:

p1 = 0;
p2 = 0;
h = 1;
data = rndn(10,2);
x = {};
if (p1==0)and(p2==0);
    cris=data[1:rows(data)-h,2];
    x=x~cris;
elseif p1>p2;
    cris=data[(p1+2):rows(data)-h,2];
    x=x~cris;
elseif p1<p2;
    cris=data[(p2+1):rows(data)-h,2];
    x=x~cris;
elseif (p1==p2)and(p2/=0);
    cris=data[(p1+2):rows(data)-h,2];
    x=x~cris;
endif;
/*

Then we will get the error

Open /&ast; &ast;/ comment G0562 : 'endif'

You need to close that comment to resolve this problem.

aptech

1,338


0



Thanks for your kind assistance.

Very much appreciated.

Ozey

 

 

Your Answer


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 30 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy