Re: How to call a Informix 4gl rutine from another 4GL rutine .
Posted in 1998
Hey John F. You have been working far too long with RDS. Your r_flag variable will by definition be an uninitialized variable that may have any value when the routine is called the first time. That's the way it is with 4GL compiled. That's the way you therefore HAVE to expect it to be with RDS. This is easy to solve however. Simply create another function that you call before all this that initializes r_flag to false. We do such initializations all the time with module level variables and we use those a lot. On Wed, 11 Feb 1998 12:08:28 +0000, "John H. Frantz" <john@rl.is> wrote: >I assume you mean function A calls function B which may end up calling >function A again directly or indirectly. If this is the case you could >define a modular variable (defined at the top of a module above the >first function statement) to flag any recursion, something like: > >define r_flag char > >function my_func() >if r_flag then > error "already called" >else > let r_flag = true > call my_func_norecurs() > let r_flag = false >end if >end function > >function my_func_norecurs() >... the real function. >end function > >The variable r_flag will be null the first time the function is called. > >Augusto Carnero wrote: >> >> Hello. >> >> I would like to know, if there is any way to avoid the recursive call of a >> informix 4Gl rutine. I mean , my intention is to make a 4GL rutine from >> another 4Gl rutine, without the use of the recursive method. >> If anybody can response this question I would apreciate it. >> >> thanks in advance. >> >> Augusto. >> >> acarnero@ven.net > >---------------------------------------------------------------------- >John H. Frantz Power-4gl: Extending Informix-4gl >john@rl.is http://www.rl.is/~john/pow4gl.html Nils Myklebust NM Data AS Norway E-mail: Nils.Myklebust@nmdata.com