User Notification Examples

The following example shows a userNotification event that is performed when a specified event occurs; for example, supplies of a product are received.

userNotification(eventType: Integer;
                 theObject: Object;
                 eventTag:  Integer;
                 userInfo:  Any) updating;
begin
    if eventType = 17 then
        displayProducts;
    endif;
end;

The following example, from the Erewhon Investments example schema supplied on the JADE release medium, shows the use of a userNotify method.

userNotify(eventType: Integer;
           theObject: Object;
           eventTag:  Integer;
           userInfo:  Any) updating;
begin
    app.mousePointer := Busy;
    zSynchronizeForm(eventType, theObject, eventTag, userInfo);
epilog
    app.mousePointer := Idle;
end;

The following example shows the use of a userNotify event that is executed when a notification registered for a user event is received.

userNotify(eventType: Integer;
           theObject: Object;
           eventTag:  Integer;
           userInfo:  Any) updating;
begin
    // The notification is identified using the eventType parameter, and an
    // appropriate message is displayed to a text box.
    if eventType = 16 then
        textBox2.text := "User Class Notification Received";
        textBox7.text := userInfo.String;
    elseif eventType = 17 then
        textBox4.text := "User Notification Received";
        textBox8.text := userInfo.String;
    endif;
end;