Macro (SVB) Programs Example - Launching a New STATISTICA Application

As discussed in Accessing STATISTICA Visual Basic Libraries, the STATISTICA Visual Basic function libraries are accessed by creating a STATISTICA.Application object. When launched from within STATISTICA Visual Basic, the current application is the one assumed by default, so the following two sets of statements are equivalent when run from within SVB:

Set x = Application
Set
a = x.Analysis(scBasicStatistics, _
Path
& "\Examples\Datasets\exp.sta")

and:

Set a = Analysis(scBasicStatistics, _
Path
& "\Examples\Datasets\exp.sta")

However, if you want to launch a new STATISTICA application from within SVB you need to create a New Application:

Sub Main

Set x = New Application
Set
a = x.Analysis(scBasicStatistics, _
Path
& "\Examples\Datasets\exp.sta")
'...
'{Additional code, analyses}
'...

End Sub

This program will launch the STATISTICA Basic Statistics module (library) and open file Exp.sta in the respective subdirectory.