home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD13271112001.psc / clsPrintDataFields.cls < prev    next >
Encoding:
Visual Basic class definition  |  2000-12-31  |  3.6 KB  |  97 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "DataFields"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = False
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = True
  14. '**********************************************************************************
  15. ' Name:         clsFields.cls
  16. ' Description:  Class Collection of the DataField Object
  17. ' Author:       Vincent Lozada
  18. ' Description:  Standard business operations supported by this business object:
  19. '                   Add     Adds a member to the Fields Collection object
  20. '
  21. '                   Clear   Removes all members from the Fields Collection object
  22. '
  23. '                   Item    Returns a specific member of a DataField Collection object
  24. '                            either by position or key
  25. '
  26. '                   Remove  Removes a member from the Fields Collection object
  27. '                            either by position or key
  28. '**********************************************************************************
  29.  
  30. Option Explicit
  31.  
  32. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  33. ' Private Class Members
  34. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  35. Private m_col_DataFields As Collection
  36.  
  37. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  38. ' Private Class Constructor/Deconstructor
  39. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  40. Private Sub Class_Initialize()
  41.     Set m_col_DataFields = New Collection
  42. End Sub
  43.  
  44. Private Sub Class_Terminate()
  45.     Set m_col_DataFields = Nothing
  46. End Sub
  47.  
  48. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  49. ' Public Class Properties
  50. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  51. Public Property Get Count() As Integer
  52. Attribute Count.VB_Description = "Returns the number of members in Fields collection"
  53.     Count = m_col_DataFields.Count
  54. End Property
  55.  
  56. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  57. ' Public Class Methods
  58. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  59. Public Sub Add(x As DataField, Optional in_str_Key As String)
  60. Attribute Add.VB_Description = "Adds a member to the Fields Collection object"
  61.     If in_str_Key = "" Then
  62.         Call m_col_DataFields.Add(x)
  63.     Else
  64.         Call m_col_DataFields.Add(x, in_str_Key)
  65.     End If
  66. End Sub
  67.  
  68. Public Sub Clear()
  69. Attribute Clear.VB_Description = "Removes all members from the Fields Collection object"
  70.     Set m_col_DataFields = New Collection
  71. End Sub
  72.  
  73. Public Function Item(ByVal x As Variant) As DataField
  74. Attribute Item.VB_Description = "Returns a specific member of a Fields Collection object either by position or key"
  75. Attribute Item.VB_UserMemId = 0
  76.     Set Item = m_col_DataFields.Item(x)
  77. End Function
  78.  
  79. Public Sub Remove(ByVal x As Variant)
  80. Attribute Remove.VB_Description = "Removes a member from the Fields Collection object either by position or key"
  81.     Call m_col_DataFields.Remove(x)
  82. End Sub
  83.  
  84. Public Function NewEnum() As IUnknown
  85. Attribute NewEnum.VB_UserMemId = -4
  86. Attribute NewEnum.VB_MemberFlags = "40"
  87.     'An enumerator is a small object that knows how to
  88.     'iterate through the items in a collection
  89.  
  90.     'The square brackets around the Collection object's
  91.     '_NewEnum method are necessary because of the leading
  92.     'underscore in the method name. This leading underscore
  93.     'is a convention indicating that the method is hidden
  94.     'in the type library.
  95.     Set NewEnum = m_col_DataFields.[_NewEnum]
  96. End Function
  97.