Error G0155: Nested procedure definition

Hi,

I have a procedure within a procedure and an error comes up as:

Line 20 in C:\Users\youx\Code\Backward_05_20
Nested procedure definition G0155

So does GAUSS not allow nested procedure?

Thank you!
Laura

1 Answer



0



You cannot define a GAUSS procedure inside of another GAUSS procedure. You can, however, define a GAUSS fn inside of a procedure. An fn is essentially a one-line procedure. Here is a quick example:

proc (1) = multiplyInputs(x, y);
    local out;
    fn multiply(arg1, arg2) = arg1*arg2;
    
    out = multiply(x, y);
    retp(out);
endp;

You an also, of course, define the sub-procedure above or below your main procedure.

aptech

1,773

Your Answer

1 Answer

0

You cannot define a GAUSS procedure inside of another GAUSS procedure. You can, however, define a GAUSS fn inside of a procedure. An fn is essentially a one-line procedure. Here is a quick example:

proc (1) = multiplyInputs(x, y);
    local out;
    fn multiply(arg1, arg2) = arg1*arg2;
    
    out = multiply(x, y);
    retp(out);
endp;

You an also, of course, define the sub-procedure above or below your main procedure.


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