vl-bb-set function to set a variable, and use vl-bb-ref to retrieve a variable's value.
VLISP provides a blackboard namespace for communicating the values of variables between namespaces. The blackboard is a namespace that is not attached to any document or VLX application. You can set and reference variables in the blackboard from any document or VLX. Use thefoobar blackboard variable to a string:
For example, the following command sets theCommand: (vl-bb-set 'foobar "Root toot toot")
"Root toot toot"
vl-bb-ref function returns the specified string. The following example uses vl-bb-ref to retrieve the value of foobar from the blackboard:
TheCommand: (vl-bb-ref 'foobar)
"Root toot toot"
Note that these functions require you to pass a symbol naming the variable you are referencing ('var-name), not the variable name (var-name).
Setting or retrieving variable values in the blackboard namespace has no effect on variables of the same name in any other namespace.
To demonstrate that document variables are unaffected by blackboard variables
_$ (vl-bb-set '*example* 0)
0
*example* variable is set to 0 in the blackboard namespace.
The_$ (vl-bb-ref '*example*)
0
_$ *example*
nil
*example* variable is nil because it has not been set in the document namespace.
The_$ (setq *example* -1)
-1
*example* variable is set to -1 in the document namespace.
The_$ (vl-bb-ref '*example*)
0
*example* is still set to the value assigned in step 1; setting the document variable of the same name in step 4 had no effect on the blackboard.
The blackboard variable namedvl-doc-set and vl-doc-ref functions to set and retrieve document namespace variables from a separate-namespace VLX, and vl-propagate to set the value of a variable in all open document namespaces. These functions are described in Referencing Variables in Document Namespaces.
VLISP also provides the