Examining the state of the application

The debugger has several windows that you can use to examine the current state of your application. One window lists the scripts that are currently executing. Other windows allow you to view and, if necessary, alter the values of fields and variables.

Calls window

To display the Calls window, choose Calls from the Debug menu.

This window displays the scripts in the current call stack and the line number at which each script is stopped. The call stack indicates the sequence of scripts called in the application. You can debug the script selected in the Call Stack by clicking Open; you can edit the script by clicking Edit.

The Calls window contains information only when the application is stopped at a breakpoint.


Clicking Unwind continues executing the script selected in the call stack and terminates all scripts that appear above the selected script in the call stack. (The scripts are terminated as though an abort script statement had been executed.) Unwind can be useful if you know a process isn’t working properly and there is little point in allowing the process to continue.

Exercise caution when using the Unwind button. It will terminate scripts without allowing them to finish normally. This could cause problems in your application, such as if a posting routine isn’t completed.


Locals window

The Locals window displays information about the variables, fields, and parameters referenced by the script currently selected in the Calls window. The Locals window is accessed by choosing Locals from the Debug menu.

When you select a different script from the call stack in the Calls window, the contents of the Locals window updates automatically.

The Locals window contains information only when the application is stopped at a breakpoint.


Expressions window

The Expressions window is accessed by choosing Expressions from the Debug menu.

This window allows you to view the value of any valid sanScript expression. Simply type the expression in the Expression field and click Evaluate. If the expression can be evaluated, its value will be displayed in the Value field. Otherwise, the Value field will contain a message indicating the expression couldn’t be evaluated.

You can also use the Expressions window to set the value of fields or variables in the application. Enter a sanScript expression indicating the item whose value you want to set, enter the value in the Value field, then click Set. Dexterity will attempt to set the item referenced by the expression to the value you entered. If the item can’t be found or the value isn’t valid, the Expressions window will beep.

The Expressions window can be accessed any time, regardless of whether the application is stopped at a breakpoint. If the application isn’t stopped at a breakpoint, all expressions must be fully qualified. If the application is stopped at a breakpoint, you can qualify the expression the same way you would qualify expressions in the script where the application is currently stopped.

Watch window

The Watch window is accessed by choosing Watch from the Debug menu.

Similar to the Expressions window, the Watch window allows you to view the values of multiple valid sanScript expressions. Simply type the expression in the Expression column. If the expression can be evaluated, its value will be displayed in the Value column. Otherwise, the Value column will contain a message indicating the expression couldn’t be evaluated.

Another way to add a watch expression is to select text in the Script Debugger window, right-click the text, and then choose Add Watch from the context menu.


The expressions in the Watch window are saved in a c-tree table in the same location as the dictionary being edited. This means you don’t have to re-enter them each time you are debugging a dictionary. To remove an expression from the Watch window, place the focus in the row and click Remove. To remove all expressions, click Remove All.

The values of the expressions are updated when you click Refresh in the Watch window. They are also updated in the following cases:

 

If you aren’t certain of the status of the expressions in the Watch window, click Refresh to ensure the expressions are up-to-date.


When execution has stopped at a breakpoint, the expressions in the Watch window are evaluated in the context of the script where execution has stopped. For example, assume you entered the expression 'Maximum Price' in the Watch window. This expression has no supplied context, such as a window name and form name, so its value cannot be determined. If execution stops in a script that is part of a window containing the Maximum Price field, the expression would have a valid context and would display the value of the window field 'Maximum Price'.

If you fully-qualify the expressions in the Watch window, you can avoid any issues with context.


Some values returned from expressions in the Watch window are too complex to display in a single line. Composite fields with multiple segments, and text fields with multiple lines of text are a common examples. To view these complex return values, you can use the Visualizer. Place the focus in the line in the Watch window containing the value you want to view, and then click Open Visualizer. The Visualizer will show the content of the expression.

Table Buffers window

The Table Buffer windowallows you to view the contents of the table buffers in your application.

You can view table buffers for forms, procedures and functions.

Form

This is a list of forms that are currently open in the application. You can view the table buffers that are part of each form. If a form is open but doesn’t appear in the list, click the Fill Forms button to update the list of forms.

Table

This is a list of the tables that are attached to the currently-selected form. Select a table in this list to view the contents of its table buffer. If the tables for a form don’t appear in this list, click the Fill Table Buffers button to update the list of tables.

Fields

Once you’ve selected the table buffer to view, the Fields list displays the fields and their values. The values displayed are updated automatically when a breakpoint is encountered. You can also update the values by clicking the Update Fields button.

Key

The keys for the selected table are displayed in the Key list. These are for informational purposes only. They don’t indicate which key was used to access the record in the table buffer.

Table information

The Info list contains additional information about how the table is being accessed. The following table describes the items that appear in this list.

[spacer]

Item

Description

Pathname

The path that was used to access the table.

Use Count

The number of table buffers the current client has for the table.

Open Count

The number of instances of the table being open on the current client.

Record Length

The length of the fixed-length portion of the record (in bytes).

Max Variable Len

The maximum length of the variable-length portion of the record (in bytes).

Number of Fields

The number of fixed-length fields in the table definition.

Number of Variable Fields

The number of variable-length fields (pictures and text fields) in the table definition.

Number of Keys

The number of keys defined for the table.

Dictionary ID

The ID of the dictionary the table definition is part of.

IsTemp

A boolean indicating whether the table is a temporary table.

OS Name

The physical name for the table (operating system name or SQL table name).

Active Lock Count

The number of active locks the current client has on the table.

Default File Handler

The default database type to be used for the table.

Open

A boolean indicating whether the table is open.

Open Mode

A string indicating whether the table is opened with read-only access, for shared access or for exclusive access.

Edit non-existing record

A boolean that is set to true when the edit table statement has reserved a record in the table. False indicates no record was reserved.

FM Error

A string indicating the error that occurred on the last table operation.

Key Range

An integer indicating the number of the key used to access the current range of records. If a range isn’t being accessed, this will be None.

Active Lock

A boolean that is set to true when the record is actively locked. Otherwise, it is set to false.



Documentation Feedback