I am trying to figure out how I can use a global variable while using NLPTR. I have added code snippet below. I am able to access global variable (x) from within funcB if I have no arguments to funcA. I understand the explanation around the global and the local variable tables. But is there a way around this limitation. I can't pass x as an argument to funcB in my code as nlptr will only let me pass more than 1 arguments. The other solution I have to use the funcA completely. But then my code won't be modular.
z = 10;
x = z/2;
start funcB(a,b) global(x);
b = a + x;
print 'In Function B' b;
I think from your question that you are expecting the local symbol table of the outer module to be the "global" symbol table of the inner module. This is not the case. There is one global symbol table (shared by all modules) and each module has a local symbol table.
One way to solve your problem is to use a GLOBAL(x) clause for both funcA and funcB.