DataView only passes a parameter string of 255 characters to the userexits at the on_event-, on_select-, pre_field-, post_field, pre_mask-, and post_mask-trigger. This string is called the application parameter, which, as a rule, is the parameter you specified in the lists of the definition modules during installation of userexits at the dialog object. For userexits at the on_event- and on_select-triggers there is a special parameter field in the event data list or menu item, respectively. For all other userexits you can specify parameters in the mask data list or the mask field list, respectively, separated from the userexit name by commas, in the fields for installing userexits. If you change these defined application parameters at runtime in your local memory, DataView will pass the modified application parameter to the userexit function.
Example: The following program shows a userexit at the on_select-trigger, which allows you to print a parameter string defined in the menu selection list. DataView directly passes the parameter string to the userexit function installed in the selektion data list.
integer func_menu (par)
char *par;
{
printf ("Parameter-String = %s\n", par);
}
At all triggers at where DataView only passes an application parameter, you can additionally request the information on the current data required at runtime from local memory.
In userexits at the pre-mask- and the post_mask-triggers you always generate the path to the local data structure using the current widget. Fields can be addressed using the field names and the row positions.
The typical program structure of a pre_mask- or post_mask-userexit on next page looks like this:
integer func_mask (par)
char *par;
{
long wdg,
mas,
fld;
wdg = dal_wdg_ret_act (); current widget
mas = dal_wdg_ret_mas (); mask of the widget
fld = dal_mas_ret_nxt_fld (mas, 0); first field
fld = dal_mas_ret_fld (mas, "Name"); field of the descriptor
... functional part ...
}
Field triggers are only active in mask edit state. Thus there is always one active mask, one active field, and one active row position (record). You can determine the values for the active objects using the corresponding functions.
The typical program structure of a userexit at pre_field- or post_field-triggers looks like this:
integer func_field (par)
char *par;
{
long mas,
fld,
row;
char mod;
mas = dal_mas_ret_act_mas (); current mask
fld = dal_mas_ret_act_fld (); current field
row = dal_mas_ret_act_row (); current row position
mod = dal_mas_ret_wrk_mod (); current work mode
... functional part ...
}