recursive

Cringer

ProgressTalk.com Moderator
Staff member
What's the concept of repetition? Recursion in Progress is easy. Just create a function/procedure that calls itself. Make sure you have a valid stop condition. The only thing to point out is that Progress doesn't handle many levels of recursion too well in my experience and will eventually run out of resources.
 

Cringer

ProgressTalk.com Moderator
Staff member
This code takes a string and moves each of the characters on one.

Code:
FUNCTION RecursiveTransform RETURNS CHARACTER
  (INPUT ip-string AS CHAR):
  IF ip-string EQ "" THEN
    RETURN "".
  RETURN CHR(ASC(SUBSTRING(ip-string,1,1)) + 1) + RecursiveTransform(SUBSTRING(ip-string,2)).
END. 

MESSAGE RecursiveTransform("abcde")
  VIEW-AS ALERT-BOX INFO BUTTONS OK.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
please give me an example of a recursion program.

thank you.

Is this an academic exercise, or is there an actual problem you are trying to solve? Finding a solution and then looking for a problem to apply it to is not the right approach, IMHO.
 

Cringer

ProgressTalk.com Moderator
Staff member
I've no idea what you mean. Maybe if you tell us exactly what you are trying to achieve and what you have tried we might be able to help first.
 

RealHeavyDude

Well-Known Member
The same way how you would design a recursive or structured database table. You can find tons of information on database design out in the internet.

Heavy Regards, RealHeavyDude.
 
Top