force, forceq,
forceqq
force, forceq,
forceqq — assign a value to a symbol, forcing the evaluation of change
functions for the symbol.
force (symbol, s_exp)
forceq (!symbol, s_exp)
forceqq (!symbol, !s_exp)
symbolA symbol.
s_expAny Gamma or Lisp expression.
The s_exp argument.
These functions are idential to the set,
setq, and setqq, functions, except in addition to assigning a value to a
symbol, and being the functional equivalent of the =
(assignment) operator, these functions force Gamma to evaluate the change
functions for the symbol even if the value has not changed.
This function is particularly useful when working with DataHub points that
contain arrays. Gamma handles arrays from the DataHub program by mapping them
automatically into Gamma arrays, so you can address individual elements.
However, in Gamma, if you have a DataHub array point, represented as
$default:myarray, you can modify an element of the
array normally, such as $default:myarray[0] = 17; but
that does not automatically write back to the DataHub instance, so nothing gets
updated. You have to rewrite the point. Logically you would do this:
$default:myarray = $default:myarray; to reassign the
point. But this is a null operation since you are just assigning the same
value again to the point. Using force,
forceq, forceqq like this:
force(#$default:myarray, $default:myarray); forces
the point change to be sent back to the DataHub instance.
The force function evaluates both of its arguments,
forceq evaluates only its second argument, and
forceqq evaluates neither of its arguments. A
symbol's value is the value returned as a result of evaluating that symbol.
Symbols constitute the Lisp mechanism for representing variables. These
functions can only affect the value of a symbol in the current scope.