Object/array support in Basic
IDE watch window

OpenOffice.org 2.0

Document - ID	Specification Owner	Last Change	Status
	Andreas Bregas	April 30, 2004	Final
Conforms to	
Applies to	Basic IDE
Task ID(s)	i20405
Category	Feature

Abstract

Currently the OpenOffice.org Basic IDE watch window is only able to display the values of simple types. Object types cannot be displayed at all and arrays are displayed in a unusual way. So the OpenOffice.org Basic IDE watch window should be enabled to also display objects and to display arrays in a more common way.

i-Team Members (The specification owner is part of the i-Team)

	Name	E-mail Address
User Experience	Bettina Haberer (BH)	bettina.haberer@sun.com
Development	Andreas Bregas (AB)	andreas.bregas@sun.com
Quality Assurance	Jörg Skottke (JSK)	joerg.skottke@sun.com
Documentation	Uwe Fischer (UFI)	uwe.fischer@sun.com

Approved for Implementation

	Approved by	Date
User Experience	Bettina Haberer (BH)	04/30/2004
Development	Andreas Bregas (AB)	04/30/2004
Quality Assurance	Jörg Skottke (JSK)	04/30/2004
Documentation	Uwe Fischer (UFI)	04/30/2004
String Review	Elizabeth Matthis (EM)	05/19/2004

Document Change History

Rev. Level	Change	Initials	Date
0.1	Initial revision	AB	04/08/2004
0.2	Corrections after first meeting	AB	04/26/2004
0.3	Corrections and new screenshots	AB	04/29/2004
0.4	Some further corrections	AB	04/30/2004
1.0	Spec finalized and reviewed by I-Team	AB	04/30/2004

Contents

Glossary	1

1	Motivation	1

2	User Scenarios	1

3	Goals	1

4	Requirements and Dependencies	1

4.1	Requirements	1

4.2	Technical Dependencies	1

5	Competitive Analyses	2

6	Detailed Specification	6

6.1	Error Conditions	8

7	Future Tasks	8

8	Notes	8

9	References	8

Glossary

Term	Description
<Term 1>	

Motivation

Currently the OpenOffice.org Basic IDE watch window can only display variable values if they have a simple type or if they are arrays. For Basic objects only <?> is displayed in the watch window. Especially for writing Basic programs using UNO / the Office API this is extremely annoying because the value of variables representing objects can only be displayed by using the print/msgbox command. This isn't acceptable at all for professional software development. So the IDE watch window functionality should be extended to also support object types.

User Scenarios

The description of user scenarios does not make much sense in this context. The user just wants to inspect a variable containing a Basic object during the runtime of a Basic macro what's not possible at the moment. The scenario itself does not differ from inspecting any other variable.

Goals

The goal is to improve the OpenOffice.org Basic IDE watch window functionality to fulfill at least the minimum requirements of popular programming environments. The ability to display object variables is a must for this.

Requirements and Dependencies

Requirements

It should be possible to display objects and arrays in the OpenOffice.org Basic IDE watch window in a meaningful way.

Technical Dependencies

There are no technical dependencies to other program parts. The automated GUI testing is only affected as automated tests may have to be adapted or created. The test tool itself is not affected.

Competitive Analyses

The appropriate reference for the OpenOffice.org Basic IDE watch window is the MS Visual Basic IDE watch window. There object type variables are displayed as root tree nodes that can be opened by clicking the corresponding + icon. When opened the icon changes to - to indicate that the tree can be collapsed again by clicking there. The object's properties and their values are displayed as leafs in the tree respectively - if the value also has an object type - as expandable nodes again.

Illustration 1 shows an example scenario during the execution of a Visual Basic macro:

Illustration 1 Watch window in Visual Basic IDE

In contrast the OpenOffice.org Basic only shows <?> for object values:

Illustration 2 Object values in OpenOffice.org Basic IDE watch window

Arrays are displayed in a strange way in the OpenOffice.org Basic IDE watch window. All values contained in an array are displayed in one single line separated by ; characters. This also refers to multi dimensional arrays where the dimensions are separated by [ and ] characters. See Illustration3:

Illustration 3 Arrays in OpenOffice.org Basic IDE watch window

In Visual Basic array are displayed in the same way as objects are displayed. Each array element is displayed as the array's “property”. For multi dimensional arrays ar(lb0...ub0,lb1...ub1,...) the first level elements are the sub arrays defined by ar(lb0,...), ar(lb0+1,...), ... , ar(ub0,...). The children nodes of this elements are the sub arrays of the next level, e.g. ar(1,lb1,...), ... ,
ar(1,lb1+1,...) and so on. See illustration 4.

Illustration 4 Arrays in Visual Basic IDE watch window

In VB there's no restriction concerning the length of arrays. If an array has 100.000 entries, all of these entries are displayed.

Detailed Specification

The OpenOffice.org Basic IDE watch window should display objects and arrays similar to the Visual Basic IDE concerning the tree mechanism. The arrangement of the information in columns “Expression”, “Value”, “Type” and “Context” will be adopted as far as possible, but there are some restrictions:

The “Expression” column will be a “Variable” column, because the watch window is not able to evaluate complete expressions.

The “Type” column could be supported but for most objects only “Object” can be displayed because more detailed information about the specific object type are not available.

The “Context” column will be not supported because the Basic core currently does not provide corresponding information and is - unlike VB - not able to display values for variables that are out of scope.

All terms inside the watch window (e.g. type names, ...to... keyword for array dimensions) don't have to be translated because they all refer to Basic keywords that are the same for all languages.

Unlike now the value of string variables will be displayed in “” to make its string type character more clear.

Illustration 5 shows how the watch window will look in the future showing objects and simple data:

Illustration 5 Objects and simple data

Illustration 6 shows how the watch window will look in the future showing arrays:

Illustration 6 Arrays

In general there may be small differences between the Illustration and the real implementation concerning the type column, because maybe not all necessary information always can be provided by the Basic core. So the illustrations show the target, but some limitations may be required.

Besides that in both illustrations the lines connecting the entries of the tree control are missing because of technical problems in the test implementation. But if possible these lines should be displayed in the watch window tree control in the final implementation.

String list

Item	English	German	Comments
Caption first column	Variable	Variable	
Caption second column	Value	Wert	
Caption third column	Type	Typ	

Key Board Shortcuts

As a standard tree control is used the usual shortcuts for this control will also be available for the watch window.

Error Conditions

There are no real error conditions. Values in the watch window may not be displayable sometimes because they are not valid, but then simply “<out of scope>” is displayed and there is no reason to change this now. The only question is what happens to open trees when the corresponding variable becomes invalid. In Visual Basic values that are out of scope are still displayed. This is not possible in OpenOffice.org Basic because the core does not offer access to variable values out of scope. So the suggestion here is to collapse the tree of an object/array running out of scope completely. If the variable becomes valid again the tree structure will not be opened again automatically because this 1. could be annoying for the user who might not intend to see the values again and 2. this would cause significant work to store the state of the trees. The MS Visual Studio C++ debugger behaves in a similar way.

Future Tasks

The watch window functionality could be enhanced by also adding a context column to the tabbed tree list and display variables out of scope if their values are available in other contexts. But this would also require changes in the Basic core.

Another feature to make the usage of the Watch Window easier could be a “Watch all” button that automatically insert all variables into the watch window that are in the local scope of a sub at this time.

Notes

<Questions will arise during the writing of the specification. State these in here.>

References

-

<Required - Specification Title>

Page 8

<Required - Path to specification>

2004-04-08T12:27:26