Hi Is there a way to invoke a program when pressing the F1 key, without adding the Call statement to the program that is doing the calling ? I would also need to pass parameters, or LDA to the program that I would be calling. Thanks, Nick
Software/Hardware used:
ASKED:
November 22, 2010 10:02 PM
UPDATED:
December 9, 2010 8:48 AM
HI
That is helpful, but not what I really need to be able to do. I am trying to invoke PGM B, from PGM A, without inserting a call statement in PGM A. In addition, I would like to be able to pass parameters to PGM B, or the LDA, from PGM A.
Thanks,
Nick
I don’t know of a way to define the {help} function in DDS to result in calling a program. Interesting concept. Passing parms would really be tricky. The LDA should work automatically of course, though loading it with anything at the time of pressing {help} would be difficult.
What are you needing to do? Why call a program? There might be alternatives.
Tom
As Tom said
There is no way that the DDS “calls” another program. You will have to put the call in your original program. And, as Tom queried, what are the issues?
Phil
The issue is that I have 100s maybe 1000s of screen programs. For any screen format that exists in any of these programs, I want to add a function key for on line help. This function key will essentially pass the screen name as a parameter, and then do a reade on a file that has all the help notes using the screen name as the key.
I don’t necessarily need to be calling an external program, if anyone can think of a better way to do this. I am trying to avoid having to add a call statement into everyone of these screen programs.
Thanks,
Nick
Thanks,
Nick
Two methods are available
One uses Help/ALTHELP/HLPARA/HLPRCD to display an record in the DDS that contains the help screen. In your DDS you would add lines like this repeating the HLPARA and HLPRCD for each record that you want to create help for (CURRCD is an existing record) and then adding a new record with the help for each.
ALTHELP
HELP
H HLPARA( *RCD CURRCD)
HLPRCD(NEWRCD)
Another built in help method is using PANEL Groups. These allow you to create a screen that looks and feels like OS/400 Help. The panel group contains a help script.
Let us know how we can help further.
Phil
This function key will essentially pass the screen name as a parameter,…
The closest I can think you’ll come is to put all records with the same “screen name” into a document. Perhaps name each document the same as the “screen name”.
You would need to change the DDS for each screen to do something to call a program anyway. You might as well just change the DDS to reference a HLPDOC. This is one of the few things that documents and folders are still good for.
Tom
Here is a wild idea.
Use the Attn Key.
That would start a Group Job.
If you not setting this a the USRPRF, you could set it to call a specific program.
That program would check the invocation stact of the other original job and determine what program was running. The yo call a new program with that as a parm and then you can go out to your help text table and display the help for that program.
Hi
I like the idea of using the attention key. How do I get the attention key to call a Group Program ? I don’t know what you mean here. Also, how do I get the the program that is currently running (invocation stack). Not familiar with how to do this either.
If I could see an example, I think it would be very helpful. Definitely would like to explore this idea.
Thanks for your thoughts.
Nick
How do I get the attention key to call a Group Program ?
That’s unimportant and generally irrelevant. It would only start a group job if your attention program told it to do so. While it might be helpful, a group job is a complication right now.
Also, how do I get the the program that is currently running (invocation stack).
Before even thinking to that degree, you probably should just start with seeing what an attention-program does and how it might affect the jobs that it runs in. Technically, we don’t know if they’re even workable in your environment. If one call be used effectively, the call stack will be reasonable.
Here’s a trivial beginning:
Compile it and call it. You should see that the USER menu appears. You can take any of the menu options or run commands on the command line, e.g., DSPSYSSTS.
If you run a command such as DSPSYSSTS, press the
That behavior will continue until you exit the USER menu. At that time, the
Tom
Assuming that
1) F1 is currently enabled for the display file record formats (or you can enable it)
2) The application program (A) is not using F1
Then Yes — a new program (B) could provide online help support without requiring the actual application program (A) to be changed. This help support could, if desired, be field sensitive or generic and tied to the record format being worked with when F1 is used (again with no change to program A).
This is not a trivial task, but I have written such programs in the past as a contractor.
Bruce
Bruce Vining Services
Nick:
Bruce Vining is someone who can make this work. If it has to be done, he is probably the path to the least cost. Not necessarily ‘cheap’, just ‘least cost’. Other paths will likely have higher costs.
Tom