Userexits at edit_action-, pre_action-, and post_action-triggers of a mask are passed a default parameter as first parameter pr1 and the application parameter pr2 described above as second parameter. The length of the complete parameter string may not be longer than 255 characters.
The default parameter contains information on the current work mode of mask edit state pr1[0] and on the current row position pr1[1]. This information is required, for action triggers - as opposed to field triggers - are not called in mask edit state and thus the local memory does not contain such data at the time of invocation.
If we consider the standard functional sequences, the following special rules apply for passing standard parameters:
Note! See also DTV User's Guide -> Masks and Fields -> Standard functional sequences in masks.
If you install userexits at the action triggers of a mask, almost always one userexit has to fulfill different tasks depending on the work mode passed in the default parameter. That's why as your first statement you always have to implement a switch controlling the branching into work modes as required.
Example: program structure of a userexit at the action trigger, printing the current work mode, the current row position and the application parameter.
integer func_action (pr1, pr2)
char *pr1,
*pr2;
{
long row;
char mod;
mod = pr1[0]; current work mode
if (pr1[1])
sscanf (&pr1[1], "%d", &row); current row position
else row = 0;
switch (mod)
{
case 'Q': if (!row)
printf ("query mode\n");
else
printf ("Break mode in row %d\n", row);
break;
case 'I': printf ("Insert mode in row %d\n", row);
break;
case 'C': printf ("Copy mode in row %d\n", row);
break;
case 'U': printf ("Update mode in row %d\n", row);
break;
case 'X': printf ("Replace-Modus in row %d\n", row);
break;
case 'T': printf ("Temporary mode in row %d\n",row);
break;
case 'R': printf ("Rollback mode in row %d\n", row);
break;
case 'D': printf ("Delete mode in row %d\n", row);
break;
default: printf ("System error !\n");
break;
}
printf ("Application parameter string = %s\n", pr2);
}