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 the vl-bb-set function to set a variable, and use vl-bb-ref to retrieve a variable's value.
For example, the following command sets the foobar blackboard variable to a string:
(vl-bb-set 'foobar "Root toot toot") "Root toot toot"
The vl-bb-ref function returns the specified string. The following example uses vl-bb-ref to retrieve the value of foobar from the blackboard:
(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.
(vl-bb-set '*example* 0) 0
The *example* variable is set to 0 in the blackboard namespace.
(vl-bb-ref '*example*) 0
*example* nil
The *example* variable is nil because it has not been set in the document namespace.
(setq *example* -1) -1
The *example* variable is set to -1 in the document namespace.
(vl-bb-ref '*example*) 0
The blackboard variable named *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.
VLISP also provides the vl-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 About Referencing Variables in Document Namespaces (AutoLISP).