You can design the command section of a C/C++ program unit any way you want. You merely need to abide by a few rules pertaining to transaction processing as described in detail in chapter "Structure and use of UTM programs":
the program units are subroutines of the UTM main routine KDCROOT
the program units must be reentrant
dialog program units must observe the strict rules of the dialog.
KDCROOT is used to designate the UTM main routine. The source program for KDCROOT is created with the KDCDEF generation tool; see the openUTM manual “Generating Applications”.
There are special rules for event exits that will be described in section “Event exits".
Local classes in C++ program units
If a local class is declared in a C++ program, then the destructor for this class may only b executed if the class is in a block whose block terminator "}" is reached before the PEND call. This restriction does not apply under LINUX.
Recommendation: Local classes should be used within their own "inner" block.
//extract of cpphello.C in sample Application extern "C" void cpphello (struct kc_ca *kb, struct work *spab) { { Demo Autoclass('A'); // further code using Autoclass } // reached after destructure call for Autoclass : : /* PEND-FI - Call */ KDCS_PENDFI(); }
KDCS calls in C/C++ program units
KDCS allows you to use the using the C/C++ macro interface, which makes it easy to supply the parameters with data (see "C/C++ macro interface") when calling UTM functions.