BBjNamespace::setCallbackForNamespaceChange

Description

In BBj 3.0 and higher, this method sets a callback that will be called if any Named Object within this BBjNamespace is changed.

Syntax

Return Value

Method

void

setCallbackForNamespaceChange(string callbackName)

void

setCallbackForNamespaceChange(UserObject userObj, string methodName)

Parameters

Variable

Description

callbackName

Specifies the name of the callback.

methodName

Specifies the method of userObj which is to be called.

userObj

Specifies a UserObject that has a method which is to be called when value changes.

Return Value

None.

Remarks

All callbacks that a program registered on a BBjNamespace are removed when that program executes START, STOP, END, or BEGIN. All callbacks registered by a BBj process are removed when the BBj process terminates.

Example

namespace! = BBjAPI().getNamespace("test","test",1)

rem 'set a callback that will be called if *any* value in namespace changes
namespace!.setCallbackForNamespaceChange("callback")

rem 'remove the callback
namespace!.removeCallbackForNamespaceChange()
end

callback:
    print "some value in ", namespace!.getName(), " has changed"

See Also

BBjAPI

BBjNamespace

BBjNamespaceEvent

Object Variables

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.