Next Previous Up Top Contents Index

5 Learning More About an Application

5.6 Browsing run-time values of variables and constants

You can browse the values of variables and constants in running applications. The browser shows the run-time value of a variable or constant in its Values page. Simply browse the definition of the variable or constant by double-clicking on it in the project's Definitions page.

The values are shown in a table. Thread variables (variables local to a particular application thread) are shown with an entry for each thread containing a variable of that name. Constants and global variables only ever have one value across all threads, so this is shown as a single table entry entitled "All threads". You can update the value shown in the browser with View > Refresh.

We will browse Reversi's *reversi-piece-shape* variable to show how we can monitor the value of a variable while an application is running. That variable stores the current shape of the pieces being used on the Reversi board. By default, Reversi uses circular pieces.

1. Start the Reversi application.
2. In the Reversi project window's Definitions page, double-click on the variable *reversi-piece-shape*.
3. In the browser, choose the Values page.

Figure 5.3 Browsing values in a running application thread.

The value of *reversi-piece-shape* is shown as #"circle" for all threads. This is what we expected. Reversi has only a single thread, and we expected some value that would represent a circle.

4. Choose Options > Squares in the running Reversi application.
5. Choose View > Refresh in the browser.

Figure 5.4 Updated variable value after changing state of application.

The value is now #"square". This reflects the internal change to the variable that our menu selection caused.


Getting Started with Functional Developer - 31 MAR 2000

Next Previous Up Top Contents Index