-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
David FOXWELL wrote:
Hi,
How can I call a program that will run in a named activation group without starting in the DFTACTGRP?
All the user menus are displayed by old programs running in the DFTACTGRP. If my program running in a named activation group was called directly from the menu, and returning to the menu I ended that group, would that be OK?
Thanks.
You can specify the activation group in which a program will run in the
compile command, but that's not required. I generally do it, via a
compiler directive (the H spec in RPG.) The value is typically a literal
name, or the special value *CALLER. The program which specifies the
activation group name, is the initial program, and can destroy the
activation group when it completes, thereby releasing all resources that
have been allocated within the group, by calling the CEETREC API
program. I generally code that as the last operation before the normal
exit. The RPG compiler doesn't know about CEETREC, so it still requires
a return or LR just to keep the compiler happy.
A RTVACTGRP command in a CL menu program would accomplish the same thing.
The advantage of CEETREC is that the menu program doesn't need to know
the name of the activation group, and it also works transparently with
system menus, and in batch jobs. If you use CEETREC, don't neglect to
specify the two parameters. Null pointers (*OMIT) can be passed when
they're not needed.
hth
Pete Hall
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkrKZyIACgkQXczQcKdXKg4B/ACdETpnr6XIh7oLud2eTmBGF50d
VSEAnj1+byY4bCj/DO8efdchqQcNi0of
=cnWR
-----END PGP SIGNATURE-----
As an Amazon Associate we earn from qualifying purchases.