Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Command section of a C/C++ program unit

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 sectionEvent 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.

Example
//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.