BBjNamespace::enableCallbacks

Description

In BBj 4.0 and higher, this method enables/disables all callbacks registered on a BBjNamespace.

Syntax

Return Value

Method

void

enableCallbacks(int enable)

Parameters

Variable

Description

enable

Any non-zero value enables all callbacks; 0 disables all callbacks.

Return Value

None.

Remarks

None.

Example

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

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

REM set a callback that will be called if the value changes
namespace!.setCallbackForVariableChange("x","xChanged")

REM set a callback that will be called if *any* value is
REM set (even if the value is not changed)
namespace!.setCallbackForNamespace("someValueSet")

REM set a callback that will be called if the value of x is set
REM (even if the values is not changed)
namespace!.setCallbackForVariable("x","xSet")


REM disable all callbacks
namespace!.enableCallbacks(0)
REM and re-enable them
namespace!.enableCallbacks(1)


REM remove all callbacks
namespace!.removeCallbackForNamespace()
namespace!.removeCallbackForNamespaceChange()
namespace!.removeCallbackForVariableChange()
namespace!.removeCallbackForVariable()


end

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

someValueSet:
print "some value in ", namespace!.getName(), " has been set"
return

xChanged:
print "the value of x in ", namespace!.getName(), " has changed"
return

xSet:
print "the value of x in ", namespace!.getName(), " has been set"
return

See Also

BBjAPI

BBjNamespace

Object Variables

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