What does a simple SVB program look like?

The following program illustrates various general features of the Visual Basic (VB and SVB) language in a simple program. In STATISTICA, select New from the File menu, then select the Macro (SVB) Program tab and create a macro called Overview 1.

Sub Main

' Bring up a Message Box, with the Ok and Cancel buttons,
' and with the following text;
' note the continuation symbol _ (underline) at the
' end of the first line, to allow the single statement
' to span two lines

MsgBox ("Hello! Click OK or Cancel", _
)=vbOK Then

MsgBox "You clicked OK"


MsgBox "You clicked Cancel"

End If

End Sub

To run this program, click the  icon on the toolbar, press F5, or select Run Macro from the Run menu. This program will display two message boxes: the first one shows an OK button and a Cancel button, and the next one will show a message depending on which button you clicked.