How to get Variable values list in STATSTICA


I have another question about STATISTICA SVB. Now I 'd like to get a list
of variable values. For grouping variable it is the list of all groups' names. I know how to get it using Variable Properties Menu but how no idea about the way of doing this in SVB macro.


New Member
Here's SVB for unique values of one variable:

Option Explicit
Option Base 1
Sub Main

Dim s1 As Spreadsheet
Dim s2 As Spreadsheet
Dim i As Long
Dim nv As Long
Dim last As Long
Dim VarList() As Long
Dim Values() As Double
Dim Labels As Variant

Set s1 = SelectSpreadsheetDialog(False)
If VarPtr(s1) = 0 Then End
ReDim VarList(s1.NumberOfVariables)
If SelectVariables1(s1, "Variable Selection", 1, 1, VarList, nv, "Select a variable:") = 0 Then End
s1.GetUniqueValues(VarList(1), True, Values(), Labels)
last = UBound(Values)

Set s2 = Spreadsheets.New
s2.Visible = False
s2.SetSize(last, 1)
s2.VariableName(1) = s1.VariableName(VarList(1))
s2.VariableType(1) = s1.VariableType(VarList(1))
For i = 1 To last
If Labels(1) ="" Then s2.Value(i, 1) = Values(i) 'number
If Labels(1)<>"" Then s2.Value(i, 1) = Labels(i) 'text
Next i
s2.Visible = True​

End Sub