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 If MsgBox ("Hello! Click OK or Cancel", _ vbOkCancel)=vbOK Then
MsgBox "You clicked OK"
Else
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.