statsoft statistica visual basic en · visual basic code for this macro) can be displayed at any ti...

7
Stasca Visual Basic - one of the strongest development environments

Upload: others

Post on 18-Oct-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: StatSoft Statistica Visual Basic EN · Visual Basic code for this macro) can be displayed at any ti me in the Visual Basic Editor. The generated macro command required is available

Statistica Visual Basic - one of the strongest development environments

Page 2: StatSoft Statistica Visual Basic EN · Visual Basic code for this macro) can be displayed at any ti me in the Visual Basic Editor. The generated macro command required is available

Statistica Visual Basic

Contents

Statistica Visual Basic 3Application scenarios for Statistcia Visual Basic programmes 3Statistica Visual Basic Macro recording 4 Analysis Macros  4 Master Macros  4 Node adaptions  5 Statistica Visual Basic Editor and Debugger  5 Visual Basic from other applications  6Running Statistica Visual Basic Macros 6 Performance of Statistica Visual Basic programmes 6 Structure of Statistica Visual Basic  6Statistica programming in .NET 7

Page 3: StatSoft Statistica Visual Basic EN · Visual Basic code for this macro) can be displayed at any ti me in the Visual Basic Editor. The generated macro command required is available

Stati sti ca Visual Basic

The industry standard Stati sti ca Visual Basic (SVB) programming language is integrated into Stati sti ca and is another alternati ve user interface that includes the full functi onality of Stati sti ca. It is much more than just a programming language for creati ng advanced applicati ons.

Note that Stati sti ca Visual Basic should not be confused with Microsoft Visual Basic 6.0. Stati sti ca Visual Basic is part of Stati sti ca and the code is currently being maintained and further developed. SVB is compati ble with Microsoft ‘s VB.NET, Microsoft ‘s Visual Basic for Applicati ons (VBA) and Microsoft ‘s Visual Basic 6.0 (VB6). Especially the fl exibility and compati bility of the SVB scripti ng language should be emphasized. SVB provides access to Visual Basic for Applicati ons (to control Microsoft Offi ce products) and access to the .NET framework within the same fi le. Other programming interfaces, such as Yahoo‘s Stock Quote API or Google Analyti cs API, can also be accessed and underline the fl exibility of SVB. SVB off ers a powerful 64-bit soluti on for system integrati on, expansion and customer development.

Stati sti ca Visual Basic takes full advantage of Stati sti ca‘s object model architecture and can control every aspect and almost every de-tail of Stati sti ca‘s functi onality. Even the most complicated analyses and graphs can be recorded as Visual Basic macros. These macros can later be run repeatedly, edited or composed of parts of other applicati ons. Stati sti ca Visual Basic adds over 14,000 new features to Microsoft Visual Basic‘s rich standard syntax, making it one of the most comprehensive development environments available.

The spectrum of applicati ons for Stati sti ca Visual Basic program-mes ranges from macro recording to automati ng common tasks to developing complex analysis systems that combine Stati sti ca‘s opti mized procedures with custom extensions in a self-created user interface.

With appropriate licensing, created analysis scripts can be integ-rated into system environments in order to be executed from the company‘s own soft ware applicati ons or by means of Internet/intranet portals.In additi on, SVB programmes can be a� ached to almost any im-portant „event“ in a Stati sti ca analysis, such as opening or closing fi les, clicking cells in a table, and so on.In this way, the STATISTICA user interface can be adapted in great detail for specifi c applicati ons (e.g. data entry, &c.).

Multi ple scripti ng languages are included in Stati sti ca. When creati ng separate macro documents, SVB, Enhanced SVB, Stati s-ti ca Visual Basic.NET or R can be chosen.

Applicati on scenarios for Stati sti ca Visual Basic programmes

With Stati sti ca 13, the workspace is now available to all Stati s-ti ca users and is enjoying increasing popularity. If data analysis includes several steps that require diff erent dialogues to be cal-led, these steps can be mapped in the workspace using indivi-dual nodes. The vast majority of work steps can be automated in this way with out-of-the-box nodes, without the need for a single line of script. Adjustments of the node outputs can be executed with recorded adjustment scripts, which can be opti onally stored for each individual output. If standard nodes with customizati on scripts should not be suffi cient to meet customer-specifi c requi-rements, the script nodes menti oned above can be used, whe-reby it is easily possible to combine script nodes of diff erent lan-guages in a workspace. In additi on, the script nodes completed for the special requirements can be added to the node browser so that they are available to all users for repeated routi ne tasks.

Enhanced Stati sti ca Visual Basic is an extension of Stati sti ca Visu-al Basic and contains additi onal functi ons. Stati sti ca Visual Basic.NET provides direct access to .NET assemblies, so that no COM Interop is required, as required by the standard SVB.In additi on, the user-defi ned script nodes in the workspace are available in languages Python, Iron Python, C#, Spark Scala, SVB and R languages. R is a programming language and environment for stati sti cal calculati ons. For more details about R, Python, C# and Spark Scala refer to Open Source.

Page 3

Page 4: StatSoft Statistica Visual Basic EN · Visual Basic code for this macro) can be displayed at any ti me in the Visual Basic Editor. The generated macro command required is available

Stati sti ca Visual Basic Macro recording

SStati sti ca off ers a wide range of opti ons for recording macros and/or SVB programmes to automate periodically repeati ng operati ons or to automati cally create programmes that can be edited and modifi ed for the following tasks. The macros recorded in this way can be executed exactly as they were stored, or can serve as building blocks for more complex and highly customized Visual Basic pro-grammes. Analysis macros and master macros follow the same syntax and can both be modifi ed later. However, due to the diff erent recording paths of these macros, they off er diff erent advantages and disadvantages for a parti cular applicati on.

Analysis Macros

Analysis Macros automati cally record the se� ngs and selected opti ons of a specifi c analysis. The term „analysis“ refers to a task called up from Stati sti cs, Data Mining or Graphics tabs. This task can be very small and simple (e.g. a sca� er plot from the Gra-phics tab), but also very complex (e.g. a structural equati on mo-del from the Stati sti cs tab that can contain hundreds of output documents).

Aft er selecti ng a command from Stati sti cs, Data Mining or Gra-phics tabs, all acti ons, such as variable selecti on, selected opti -ons, &c., are recorded in the background. This recording (i.e. the Visual Basic code for this macro) can be displayed at any ti me in the Visual Basic Editor. The generated macro command required is available in every analysis dialogue aft er clicking the opti ons bu� on.

If an analysis dialogue has been minimized and is listed in the analysis item, the command can also be called up in the corre-sponding context menu (access by right mouse click on the ana-lysis bu� on in the analysis bar).

Master Macros

With a Master Macro, you can record an enti re session consisti ng of one or more analyses. This recording combines the various analyses from Stati sti cs, Data Mining or Graphics tabs with their diff erent analysis opti ons. In additi on, the recording of a Master Macro can also be switched on and off in contrast to the recor-ding of the Analysis Macro.

The recording of the Master Macro starts by selecti ng the com-mand protocol recording of analysis (Master Macro) in the start tab of the macro menu, and ends when the stop recording com-mand is selected in the same menu.

Apart from these two acti ons, in additi on to the analyses and the selected order of these analyses, selecti ons of fi les and data operati ons are also recorded.

Page 4

Page 5: StatSoft Statistica Visual Basic EN · Visual Basic code for this macro) can be displayed at any ti me in the Visual Basic Editor. The generated macro command required is available

Node adapti ons

The third variant of script recording refers to the workspace, which has replaced the dialogue mode as the most popular user interface due to its excellent usability. In the context menu of a node, the output opti ons can be called up so that the node adap-tati on dialogue is invoked.

Any output can be selected in the upper window of the node adaptati on dialogue. If the record script bu� on is then selected, the subsequent script recording is automati cally added to this output.

The upper window shows that the new ti tle script record has been added to the credit rati ng histogram output. The scripts listed in the lower window can be assigned to any output in the upper window using Drag&Drop.If the Stati sti ca Server is licensed, customizati on scripts gene-rated in this way can be exported to the enterprise manager system view using the enterprise deployment bu� on. The new script bu� on allows previously recorded customizati on scripts to be re-imported into a workspace so that the enterprise manager system view can functi on as an enterprise-wide repository.

Stati sti ca Visual Basic Editor and Debugger

In the professional Stati sti ca Visual Basic development environ-ment, programmes can also be completely rebuilt. A convenient programme editor with a powerful Debugger (including breakpo-ints) and many other tools for effi cient code building are available for this purpose.When a macro is edited entering Visual Basic commands or SVB program instructi on, an automati c word recogniti on for auto-mati c completi on of these commands is acti vated. In additi on, a toolti p appears that indicates the correct syntax of the com-mand. A help to the members and functi ons of each individual class can also be called.

Breakpoints can be set in the programme so that line by line it is possible to observed how the variable values change during programme executi on.

Page 5

Page 6: StatSoft Statistica Visual Basic EN · Visual Basic code for this macro) can be displayed at any ti me in the Visual Basic Editor. The generated macro command required is available

In summary, Stati sti ca Visual Basic is not just a powerful programming language, but a very powerful, professional development en-vironment that is ideal for creati ng simple macros as well as complex custom applicati ons.

Visual Basic from other applicati ons

SVB programmes can also be part of Visual Basic programmes created within other applicati ons (e.g. Excel) by calling up the appro-priate STATISTICA functi ons and procedures.

In additi on, an interacti ve dialogue editor is provided with which the creati on of new dialogues can be realized easily.

Running Stati sti ca Visual Basic macros

Stati sti ca Visual Basic programmes can be executed within Stati sti ca. However, since SVB is compati ble with the industry standard, programmes can also be executed from any other compati ble environment (e.g. Excel, Word or a pure Visual Basic language). In prac-ti ce, this means that you can usually call up Stati sti ca functi ons using Visual Basic in another applicati on.

Note that (unlike functi ons from MS Visual Basic) to start an SVB programme or a� empt to call Stati sti ca functi ons from other ap-plicati ons, the Stati sti ca libraries must be present on the running computers for the functi ons to run. This means that the user of the programme must be a licensed user of the Stati sti ca libraries for the procedures. Furthermore, it should be noted that this huge Stati sti ca functi on library (with more than 14,000 procedures) is not only open to access by Visual Basic, but also to call up from any other compati ble programming language or environment such as C/C++, C# or Delphi.

Performance of Stati sti ca Visual Basic programmes

The obvious advantages of Visual Basic (compared to other lan-guages) are its ease of use and its popularity with a large number of PC users. A possible disadvantage of Visual Basic programmes is that the processing speed is lower than that of applicati ons developed in a lower-level programming language (such as C).

This potenti al problem usually does not exist with SSVB appli-cati ons, especially if they consist mainly of call-ups of analyses, graphs and data manipulati ons from Stati sti ca. These procedu-res fully implement Stati sti ca‘s technology to run as fast as if the corresponding procedures were performed directly in Stati sti ca.

Structure of Stati sti ca Visual Basic

Stati sti ca Visual Basic consists of two components:(1) The general Visual Basic development environment with tools and extensions for the development of user interfaces (dialogu-es) and (2) the Stati sti ca libraries with thousands of functi ons that allow access to practi cally all functi onaliti es of Stati sti ca. The Visual Basic development environment basically follows the syn-tax conventi ons of Microsoft Visual Basic. Minor diff erences are mainly in the way dialogues are created to give programmers/developers more fl exibility in creati ng user interfaces within com-plex programmes.

In the SVB development environment, dialogues can be proces-sed completely within separate subrouti nes, which can be fl e-xibly combined to larger programmes with multi ple dialogues, whereas under MS Visual Basic the dialogues and all events wit-hin these dialogues are processed in separate programme units

Page 6

Page 7: StatSoft Statistica Visual Basic EN · Visual Basic code for this macro) can be displayed at any ti me in the Visual Basic Editor. The generated macro command required is available

Statistica programming in .NET

Almost every aspect of Statistica is also available in the form of COM interfaces, which are registered on a computer during the Sta-tistica installation. Due to the fact that .NET languages cannot communicate directly with COM, a wrapper class called COM Interop is used to integrate the Statistica libraries into the .NET project. If Visual Studio .NET is used as an integrated development environment, the COM Interop is created automatically when a COM interface is imported. COM Interop is responsible for all details regarding the interaction of the COM libraries within .NET. After connecting COM Interop, the STATISTICA COM interfaces can be handled like any other .NET object.

StatSoft (Europe) GmbH Possmoorweg 122301 Hamburg, Germany

Tel.: +49 (0)40 2285900-0E-Mail: [email protected]

www. statsoft.de/en