TechTalk: Recursive Calls

General
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

From: Toby Miller To: All

I have a menu system that I wrote in RPG to handle all of our users' various systems. I want to add the following feature, and was wondering if anyone had any ideas. I would like a user to be able to hit the Attn key from within the menu system and get another menu system display. I tried this by putting the menu system program name in the Attention key field on the user profile, but RPG does not allow for recursive calls to programs. I have gotten it to work by putting an alternate copy of the menu program out in the same library. I remember seeing somewhere a better way to deal with this type of problem, but cannot recall it.

From: James Coolbaugh To: Toby Miller

We created a command to test if a program is currently active. Then, in our Attn program, we can check to see if the program is already active for this user/job. If so, we don't allow the recursive call. I believe that there have been several examples of this in MC and other magazines.

From: Toby Miller To: James Coolbaugh

Thanks for the reply. I was looking for a way to "emulate" recursive calls, but I think I have answered my own question.

I set up a secondary program that is the Attn key program for my menu system (which is program MS0010). When a user running the menu system (MS0010) presses the Attn key, the secondary program picks it up and starts the group job with MS0010 as the initial program. This suspends the first MS0010 in the stack, allowing it to run again. Works just great for allowing hot-keying between different menus while in a program.

From: Trevor Lazarus To: Toby Miller

You may notice that the group job is really a new job and not a suspension of the current job. I use group jobs to jump between several sessions: one has DDS source open; another has the program source open; a third has the application in test. Group jobs are underutilized.

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: