Macro (Statistica Visual Basic) Overview
The Statistica Visual Basic language (integrated into Statistica) is compatible with the industry standards and offers incomparably more than just a "supplementary application programming language" that can be used to write custom extensions.
Statistica Visual Basic (SVB) takes full advantage of the object model architecture of Statistica and is used to access programmatically every aspect and virtually every detail of the functionality of the program. Even the most complex analyses and graphs can be recorded into Visual Basic (SVB) macro programs and later be run repeatedly or edited and used as building blocks of other applications. Statistica Visual Basic adds an arsenal of more than 14,000 new functions to the standard comprehensive syntax of Microsoft Visual Basic thus comprising one of the largest and richest development environments available.
Creating Statistica Visual Basic programs
There are several methods in which Statistica Visual Basic programs can be created:
Executing Statistica Visual Basic programs. Statistica Visual Basic programs can be executed from within Statistica, but because of the industry standard compatibility of Statistica Visual Basic, you can also execute its programs from any other compatible environment (e.g., Microsoft Excel, Microsoft Word, or a stand-alone Visual Basic language). In practice, you would typically call Statistica functions from Visual Basic in another application. Note, however, that when you run a Statistica Visual Basic program or attempt to call Statistica functions from any other application, all calls to the Statistica specific functions (as opposed to the generic functions of MS Visual Basic) will be executed only if the respective Statistica libraries are present on the computer where the execution takes place. That is, the user of the program must be a licensed user of the respective Statistica libraries of procedures. Note that this large library of Statistica functions (more than 14,000 procedures) is transparently accessible not only to Visual Basic (either the one that is built in, or a different one), but also to calls from any other compatible programming language or environment, such as C/C++, Java, or Delphi.
Applications for Statistica Visual Basic programs. Statistica Visual Basic programs can be used for a wide variety of applications from simple macro (SVB) programs recorded to automate a specific (repeatedly used) sequence of tasks, to elaborate custom analytic systems combining the power of optimized procedures of Statistica with custom developed extensions featuring their own user interface. Scripts for analyses developed this way can be integrated into larger computing environments or executed from within proprietary corporate software systems or intranet or Internet portals. SVB programs can also be attached to virtually all important "events" in an analysis with Statistica such as opening or closing files, clicking on cells in spreadsheets, etc.; in this manner, the basic user interface of Statistica can be highly customized for specific applications (e.g., for data entry operations, etc.).
Performance of Statistica Visual Basic programs. While the obvious advantages of Visual Basic (compared to other languages) are its ease of use and familiarity to a very large number of computer users, the possible drawback of Visual Basic programs is that they do not perform as fast as applications developed in lower level programming languages (such as C). However, that potential problem does not apply to Statistica Visual Basic applications, especially those that rely mostly on executing calls to Statistica's analytic, graphics, and data management procedures. These procedures fully employ Statistica technology and perform at a speed comparable to running the respective procedures in Statistica directly.
Structure of Statistica Visual Basic. Statistica Visual Basic consists of two major components: 1) The general Visual Basic Programming Environment with facilities and extensions for designing user interfaces (dialogs) and file handling, and 2) the Statistica libraries with thousands of functions that provide access to practically all functionality of Statistica.
The Statistica Visual Basic programming environment follows the industry standard syntax conventions of the Microsoft Visual Basic Language; the few differences pertain mostly to the manner in which dialog boxes are created (see Custom Dialogs; Custom User Interfaces), and are designed to offer programmers/developers more flexibility in the way user interfaces are handled in complex programs. In the Statistica Visual Basic programming environment, dialog boxes can be entirely handled inside separate subroutines, which can be flexibly combined into larger multiple-dialog programs; MS Visual Basic is form based, where the forms or dialog boxes, and all events that occur in the dialog boxes, are handled in separate program units.
There are three general categories of macros that can be automatically created as you run the program:
All three follow the identical syntax and can later be modified, but because of the different ways in which each of them is created, they offer distinctive advantages and disadvantages for specific applications.
When editing macro programs by typing in general Visual Basic commands or program commands specific to Statistica Visual Basic, the editor displays type-ahead help to illustrate the appropriate syntax.
Help on the members and functions for each class (object) is also provided in-line (see also The Statistica VB Object Model).
When executing a program, you can set breakpoints in the program, step through line by line, and observe and change the values of variables in the macro program as it is running.
To summarize, Statistica Visual Basic is not only a powerful programming language, but it represents a very powerful, professional programming environment for developing simple macros as well as complex custom applications.
For further information, see: