Which data types are supported in SVB?

STATISTICA Visual Basic supports several data types including Double, Integer, Long, Boolean, String, Variant, and Object.

The Double data type and the Integer and Long data types are probably the ones most commonly used in computations. Variables declared as Double can hold (store) real numbers, approximately in the range from +/-1.7E +/- 308 (approximately 15 digits of precision); variables declared as Integer can hold (store) integer numbers in the range from -32,768 to 32,767, and Long variables can hold (store) integer numbers in the range from -2,147,483,648 to 2,147,483,647; other common data types are Boolean (True [1] or False [0]) and String (a string variable of arbitrary length).

Declaring variables. Variables should be declared at the beginning of each program by using the dim command; for example:

   ...

Dim i As Integer, j As Long

Dim x As Double, v As Variant

   ...

The Variant data type. A data type that is particularly useful when incorporating STATISTICA statistical procedures into your SVB program is the Variant data type. A variable declared as a Variant data type can be empty, numeric, currency, date, string, object (see What is meant by the term "object model?"), error code, null or array value. Here is an example program that demonstrates the Variant data type.

' This program illustrates the Variant data type;
' Variant's can be empty, numeric, currency, date,
' string, object, error code, null or array value;
' here, only the numeric, currency, and string
' identities are illustrated.

Sub
Main

Dim CurrentDateAndTime As Variant
' The Now function will return the current system
' time and date.
CurrentDateAndTime = Now
AsDouble(CurrentDateAndTime)
AsLong(CurrentDateAndTime)
AsCurrency(CurrentDateAndTime)
AsString(CurrentDateAndTime)

End Sub

 

Sub AsDouble (x As Double)

MsgBox "x+1=" & Str(x+1)

End Sub

 

Sub AsLong (x As Long)

MsgBox "x+1=" & Str(x+1)

End Sub

 

Sub AsCurrency (x As Currency)

MsgBox "x+1=" & Str(x+1)

End Sub

 

Sub AsString (x As String)

MsgBox x

End Sub

Note that all variables that are used in a program but are not explicitly declared, will automatically default to type Variant.