BBjNamespace::setCallbackForVariable
Description
In BBj 3.0 and higher, this BBjNamespace method sets a callback that will be called whenever the specified variable is set.
Syntax
Return Value |
Method |
---|---|
void |
setCallbackForVariable(string varName, string callbackName) |
void |
setCallbackForVariable(string varName, UserObject userObj, string methodName) |
Parameters
Variable |
Description |
---|---|
callbackName |
Specifies the name of the callback to be called when the value is set. |
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 is set. |
varName |
Specifies the name of the object being watched. |
Return Value
None.
Remarks
The callback set using setCallbackForVariable will be called whenever the value for the specified variable is set, even if the new value is the same as the previous value. This is different from a callback set using the setCallbackForVariableChange(), which will only be called if the new value is different from the old value.
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
|
See Also
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.