[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Recursive function in SQRW



Sehat,

The short answer is that it can't be done.  "Local" variables and
parameters in SQR are not not like local variables in most languages.
There is only only copy per invocation of the program, as opposed to
being kept in a call stack.  So recursive calls in SQR are little more
than elaborate looping construct.

The good news is that anything that can be done with recursive
procedures can be done without them.  To remove the recursion from an
algorithm you basically create your own array to emulate a call stack.
I have done this on a couple on occasions.  E-mail me if you are
interested in the gory details.

Hope This helps,  (or at least that you aren't too disappointed)
Eric

*Sehat Rosny wrote:
>
> Hello
>
>         Have any one of you ever
> implement recursive procedure in SQRW ?
> Or is it possible to do recursive in SQRW?
> (the global variable of SQRW made recursive
>  hard to implement)
>
> thank you in advance.
> any comment is welcome
>
> bye
> Sehat Rosny
> PeopleSoft and SQRW Developer