Object-Oriented Spreadsheets as a Custom Software Development Environment T. C. O'Haver, University of Maryland, 1992. One of the problems of developing custom laboratory data processing software is that even relatively simple jobs often take a substantial amount of time to write, debug, and document. In recent years the problem has been exacerbated by the growing popularity of "point and click" graphical user interface environments, which can make software easier to use but which have the reputation of being difficult to program. There are a number of possible solutions to these problems, including improved conventional languages (e.g. Microsoft's Visual Basic), graphical programming systems (e.g. National Instrument's LabView), and spreadsheet macro languages. In this connection a little-known spreadsheet product called Wingz (Informix Software Inc., 4100 Bohannon Dr., Menlo Park, CA 94025; 1-800-331-1763) is especially interesting. Wingz combines the familiar number-crunching and data plotting capabilities of a spreadsheet with the flexibility of a programming language. It has become popular for cross-platform development in organizations that have a wide variety of hardware platforms; the program is available for Microsoft Windows, OS/2 Presentation Manager, Macintosh, Motif, and Open Look, and it maintains a consistent user interface across all these platforms. In fact, the largest market for Wingz are corporate customers who creating internal, customized end-user applications. Wingz has all of the expected capabilities of a modern spreadsheet, including 2D and 3D graphics integrated directly onto the worksheet, a large number of built-in functions, cell protection and formatting, named variables and ranges, elementary database functions, and even multilinear regression and matrix operations. It is a very capable performer - in fact, comparative reviews in the personal computer press have demonstrated that its speed, graphics capabilities, and data capacity exceed the leading programs in many respects (1). But what is really unique about Wingz is its built-in programming language, called HyperScript, which is as close as a spreadsheet macro language has ever come to a general purpose programming language. Coupled with its object-oriented design, this gives Wingz real utility as a development tool for end-user programming projects. HyperScript is an English-like scripting language that has many of the familiar features of conventional languages. There are local and global variables, if/else and case decision statements, for and while loops, user-defined functions and procedures with local variables and pass-by-value parameters, function recursion, etc. It is even possible to call external functions and procedures written in conventional languages (Pascal and C), although this seems much more complex. As expected, there are also many spreadsheet-specific commands, such as commands for transferring information to and from spreadsheet cells and ranges and commands to perform from scripts any operation that can be done manually when using a spreadsheet in the usual way. As is common in modern spreadsheets, there is a "macro recorder" that converts user actions into scripts that can be edited. An application developed in Wingz tends to be highly modular and object-oriented (2), with separate functions encapsulated in individual scripts rather than embedded into one long text listing. But what really sets HyperScript apart is the ease with which one can construct a complete modern user interface for end-user projects. There are simple commands for creating many of the user-interface objects that modern users have come to expect: pull-down menus, pop-up menus, scrolling text fields and list boxes, windows, buttons, number wheels, calibrated sliders, radio buttons, check boxes, and many more. These objects can be copied and pasted between worksheets and can be placed either directly on the worksheet or in dialog boxes that are called up by pull-down menu selection of from other dialog boxes. Pull-down menus can be dynamically added and removed and menu items can be displayed in greyed, checked, and styled text. The scrolling text fields can display character-by-character formatted text with mixed typefaces, sizes, and styles. Taken together, these capabilities allow the programmer to construct spreadsheet templates with an attractive, self-documenting, interactive user interface that accepts and displays information for the end user, while the full power of the spreadsheet is performing calculations in the background. (The power of Hyperscript for user interface construction is demonstrated by the fact that all of the menus and dialog boxes of Wingz itself is written in Hyperscript. The source text is included in the package so advanced users can see examples of relatively sophisticated Hyperscript programming). In general, scripts may be used for two proposes: (a) to automate spreadsheet operations that would otherwise be performed manually, and (b) to perform operations that are not easily accomplished within the spreadsheet metaphor. Scripts may be written using the built-in script editor and the automatic recorder ("learn" mode); they are automatically complied when saved or executed. Saved scripts may be executed by using the "Run script..." menu selection or, most conveniently, by attaching them to pull-down menu selections, buttons, sheets, text fields, or other control objects. Event handlers can be included in a script to invoke automatic execution of particular operations when different events occur, e.g. when a sheet is activated or deactivated, when the mouse is clicked or double-clicked in a particular screen object, when an error occurs, when a specific time elapses, etc. An easy way to automate a repetitive series of steps is to use the button tool on the tool palette to drag a new button onto the worksheet, go into the "learn" mode and then perform the desired operation manually in the usual way. The script for that operation is automatically generated and attached to the button, so that when you click the button with the mouse pointer, the script is executed. The button can be labeled with a descriptive name and moved to any position on the sheet, resulting in a very convenient and intuitive operation for end users. A typical complex project might have several such scripts activated by on-screen buttons or by pull-down menu selection. Compared to products that are designed specifically for laboratory programming , such as LabView or Strawberry Tree's Workbench, Wingz is simpler, smaller, less expensive, and requires less computer memory and disk space. Compared to application contruction tools such as HyperCard or ToolBook, Wingz is much better suited for calculation-intensive applications. References R. G. Cote and D. L. Edwards, "Captains of Crunch", Byte 17, 222 (1992) T. C. O'Haver, "The Object is Productivity", Intelligent Instruments and Computers March-April, 1992, p 67-70.