VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Printit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'Klasa Printit
Implements ParseObject
Implements Command
Private dta As data
Private value As Integer
Private typ As Integer
Private kids() As Kid
Private ptable As ListBox
Private args As New Collection
    
Public Sub init(ByVal s As String, kd As data, ByVal pt As ListBox)
  Set dta = kd
  Set ptable = pt
  ParseObject_init
End Sub
'-----------------------------------
Private Sub Command_Execute()
  Dim pline As String
  Dim i, j, k As Integer
  Dim tabc As String
  Dim mv As Multvar
  Dim pv As ParseObject
  Dim vlist As Collection
  
  tabc = vbTab
  kids = dta.getData()
  ptable.Clear
  For i = 1 To UBound(kids)
    pline = ""
    For j = 1 To args.Count
      Dim v As ParseObject
      Set v = args(j)
      If TypeOf v Is Multvar Then
        Set mv = v
        pline = ""
        Set vlist = mv.getVector()
        For k = 1 To vlist.Count
          Set pv = vlist(k)
          pline = pline + kids(i).getData(pv.getValue()) + " "
        Next k
      Else
        Set pv = v
        pline = pline + kids(i).getData(pv.getValue()) + " "
      End If
    Next j
    ptable.AddItem pline
  Next i
  ptable.Refresh
End Sub
    
Private Sub ParseObject_addArg(p As ParseObject)
  Dim newargs As Collection
  args.add p
End Sub

Private Function ParseObject_getType() As Integer
  ParseObject_getType = typ
End Function

Private Function ParseObject_getValue() As Integer
  ParseObject_getValue = value
End Function

Private Sub ParseObject_init()
  value = PRINT_IT
  typ = VERB_TYPE
End Sub

Private Sub ParseObject_setData(dt As data, ByVal pt As ListBox)
  Set dta = dt
  Set ptable = pt
End Sub
