Resources

Nested procedure definition error in a sub-routine procedure

0

Hi, I meet a problem when I try to run a stochastic dynamic programming program. well, there is a sub-routine procedure named PF below the main program that need to invoke a external .src named BLIP which lies in a .src file named Function.src in my current dictionary. It's like

/* Policy function via linear interpolation: kgrid, zgrind, and hmat must be given as a global matrices */

proc(1)=PF(k,z);

local knext;

knext=BLIP(kgrid,zgrid,hmat,k,z);

retp(knext);

endp;

And I write function.src into a .lcg file and use lib command to infer to the lib at the beginning . However error still arises

 

Line 231 in D:\Gauss\src\Heer_2ed\Ramsey3d.g
Nested procedure definition G0155
Line 231 in D:\Gauss\src\Heer_2ed\Ramsey3d.g
Syntax error G0008 : 'proc(1)=PF(k,z)'

so can I tackle this problem, thankyou

 

Tags: asked April 1, 2014

2 Answers

0

Hello,

How did you add the src file to the .lcg file? Did you use the GAUSS Library Tool or the lib command. What library did you add this file to?

I may be misunderstanding, but it sounds to me like you are saying that you are referencing the library that contains this BLIP procedure by using the lib command.

The simplest way for your code to know about BLIP is to add the line:

#include function.src

to the top of the file that defines PF.

aptech
342
0

well,I have tried this method but it simply doesn't work. Actually, my error type is Nested procedure definition not Undefined symbol. I have sent you my main program and the .lcg file Heer_2ed_dge for you to check,thank you