Visualization Tools User's Guide


Assignments

Objects displayed by the Snooper can be assigned to global variables. These objects can then be used in expressions in any workspace or in a built-in evaluation pane of the Snooper.

By evaluating expressions referring to an object, sending it various messages, observing their effect, and inspecting returned values, a user can learn more about objects which have been discovered using the basic snooping operations.

The Snooper uses the global variable names X, Y, Z, and S. It uses single-letter variable names for convenience and to avoid conflicts (most programs are likely to use more descriptive names for their global variables).

To assign an object to X:

  1. Select the object in the Snooper.
  2. Press the X := button. (Or, press alt+X, or from the Actions menu or the popup menu select X := selected item).

    The variable X in any workspace will now refer to the object that was selected.

To capture up to three objects as X, Y, and Z:

  1. Select up to three objects in the Snooper.
  2. From the Actions menu select X, Y, Z := selected items.

    The global variable X will now refer to the first selected object; Y will refer to the second selected object, if there were two or three (otherwise it will be undefined); and Z will refer to the third selected object, if there were three (otherwise it is undefined).

To assign any number of objects to an array called X:

  1. Select the items.
  2. From Actions select X := Array of selected items.

    X will now refer to an array containing all of the selected objects.

To set the Snooper so that whenever an object is selected, it is assigned to S:

  1. From the Options menu, select S := Single Selection. (Or, press control+alt+S).

(Note: This is very dangerous -- it is far too easy to get confused about what item is currently referred to by S -- but it is useful on occasion).


[ Top of Page | Previous Page | Next Page | Table of Contents ]