# hb_setListenerAdd()

Syntax

  C Prototype
  #include <hbset.h>
  hb_setListenerAdd( PHB_SET_LISTENER_CALLBACK callback ) --> int

Arguments

  <callback> A pointer to a function taking two enum parameters and returning no value. The first parameter identifies the SET parameter that is to be changed and the second parameter identifies whether the call is from before or after the value is changed. The callback function will be called twice whenever a SET parameter is changed using the Harbour SET function. The first call takes place before the SET value is changed and the second one is after the SET parameter has been changed.

Returns

  An integer value representing the callback handle, in case the caller needs to deactivate the callback function.

Description

  This function allows a subsystem that needs to track the status of some SET parameters to be notified whenever a SET parameter gets changed.

Examples

          void callback_function( HB_set_enum set, HB_set_listener_enum when )
          {
             printf("\nCalled for SET parameter %d %s changing.",
                set, (when ? "after" : "before"));
          }
          int handle = hb_setListenerAdd( callback_function );

Status

  Ready

Compliance

  Compliance is not applicable to API calls.

Files

  Library is rtl

Platforms

  All

See Also

- hb_setListenerRemove()