calling a function from inside another fucntion

whwar9739

Member
First is this allowed??

I currently have two functions defined with one using the other, and I get the following error:
** Unable to understand after --".......". (247)
** include.i Could not understand line xxx. (198)

Here would be a simple example:

Code:
function fun-1 returns date( input l-d as date ):
   return l-d + 10.
end function.

function fun-2 returns char( input l-x as int):
    def var l-date as date.
    l-date = fun-1(1/1/2010).
    return "xxx".
end function.
 

RealHeavyDude

Well-Known Member
You can nest function invocations and procedure calls as long as you don't hit the nested block limit - which is I think 255 at the maximum.

  • You don't reveal the Progress/OpenEdge version you using
  • You don't reveal the erroneous code - the error message comes from another piece of code that you don't present.

Heavy Regards, RealHeavyDude.
 

4GLNewbie

Member
Uhm maybe it's not your problem, but why don't you use names with "_" character and not "-" or you just remove the "-" ? I.e. fun_1, l_d, fun_2, etc or fun1, ld, fun2..
 

TomBascom

Curmudgeon
The sample code compiles just fine.

As RHD mentioned, the error comes from some other piece of code. There are no references to "include.i" in this code (and "xxx" is not a valid line number, nor is "......." very likely to be what the compiler couldn't understand).

If you're going to ask for help with errors you need to post the actual errors.

If you're going to post code that supposedly generates errors you need to post the actual code that actually generates the errors.
 
Top