home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / PVb5.0 / VB / SAMPLES / PGUIDE / PROGWOB / PWOTESTC.CLS < prev    next >
Encoding:
Visual Basic class definition  |  1997-01-29  |  2.3 KB  |  82 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "TestClass"
  6. Attribute VB_GlobalNameSpace = False
  7. Attribute VB_Creatable = True
  8. Attribute VB_PredeclaredId = False
  9. Attribute VB_Exposed = False
  10. Option Explicit
  11. ' >>╫ε║├╘┌í░╚½─ú┐Θ▓Θ┐┤í▒─ú╩╜╧┬╘─╢┴íú<<
  12. '
  13. ' ┤µ┤ó╡≈╩╘▒Ω╩╢║┼íú
  14. Private mlngDebugID As Long
  15. Implements IDebug
  16.  
  17. ' ╦╜╙╨╡─┤µ┤ó╡─╙├╗º╢¿╥σ└α╨═(UDT)ú¼╙├└┤╘┌╢╘╧≤╓«╝Σ┤½╡▌íú
  18. '   UDT ╘┌▒Ω╫╝─ú┐Θ╓╨▒╪╨δ╔∙├≈╬¬ Publicíú(▓╬╝√ modFriends).
  19. '  (╘┌▒╛└²╓╨ú¼ mDemo ╝╚┤µ┤ó Demo ╩⌠╨╘╙╓┤µ┤ó GetDemo/SetDemo Function/Sub ╢╘íú)
  20. Private mDemo As udtDEMO
  21.  
  22. ' Demo  ╩⌠╨╘ú║  Demo ╩⌠╨╘╡─ Property Get ║═ Let
  23. ' -----------     ╧╘╩╛╙├ Friend ╣╪╝ⁿ╫╓╔∙├≈╡─╩⌠╨╘╣²│╠╚τ║╬─▄╣╗╜╙╩▄▓ó╖╡╗╪╥╗╕÷ UDTíú
  24. Friend Property Get Demo() As udtDEMO
  25.     Demo = mDemo
  26. End Property
  27. ' ╫ó╥Γú║Property Let ╡─▓╬╩²▒╪╨δ╩╟╢╘ UDT ╡─░┤╡╪╓╖╥²╙├(ByRef)íú
  28. Friend Property Let Demo(NewDemo As udtDEMO)
  29.     mDemo = NewDemo
  30. End Property
  31.  
  32. ' GetDemo ╝░ SetDemo ╧╘╩╛╙╤╘¬║»╩²╚τ║╬─▄╣╗╖╡╗╪ UDTú¼
  33. ' -------------------   UDT ╚τ║╬─▄╣╗│╔╬¬╙╤╘¬╣²│╠╡─▓╬╩²íú
  34. Friend Function GetDemo() As udtDEMO
  35.     GetDemo = mDemo
  36. End Function
  37. ' ╫ó╥Γú║╥╗╕÷╣²│╠╡─ UDT ▓╬╩²▒╪╨δ╔∙├≈╬¬ ByRefíú
  38. Friend Sub SetDemo(NewDemo As udtDEMO)
  39.     mDemo = NewDemo
  40. End Sub
  41.  
  42. ' SetDemoParts ╩╟╙├└┤╠ε╨┤ UDT ╘¬╦╪╡─╕¿╓·╖╜╖¿ú¼
  43. ' ------------      ╦∙╥╘╛═╙╨┴╦╥╗╨⌐╥¬┤½╡▌╡──┌╚▌íú
  44. '   ╘┌╩╡╝╩│╠╨≥╓╨ú¼UDT ╡─╘¬╦╪╜½═¿╣² TestClass ╢╘╧≤╓╨╡─┤·┬δ▒╗╠ε╨┤íú
  45. Public Sub SetDemoParts(ByVal A As Integer, _
  46.         ByVal B As Long, ByVal C As String)
  47.     mDemo.intA = A
  48.     mDemo.lngB = B
  49.     mDemo.strC = C
  50. End Sub
  51.  
  52. ' ShowDemo ╧╘╩╛ UDT ╡─╘¬╦╪ú¼╦∙╥╘┐╔╥╘╘┌░╤ UDT ┤½╡▌╡╜╡┌╢■╕÷╢╘╧≤╓«║≤Σ»└└╓«íú
  53. ' --------
  54. Public Sub ShowDemo(ByVal Title As String, _
  55.         ByVal Direction As String)
  56.         
  57.     MsgBox Direction & "  " _
  58.         & GetDebugString(Me) & vbCrLf & vbCrLf _
  59.         & mDemo.intA & vbCrLf _
  60.         & mDemo.lngB & vbCrLf _
  61.         & mDemo.strC, , Title
  62. End Sub
  63.  
  64. Private Sub Class_Initialize()
  65.     mlngDebugID = DebugInit(Me)
  66. End Sub
  67.  
  68. Private Sub Class_Terminate()
  69.     DebugTerm Me
  70. End Sub
  71.  
  72. ' -------- IDebug ╩╡╧╓ --------
  73. '
  74. ' IDebug.DebugID ╧≥─·╠ß╣⌐╥╗╓╓╩╢▒≡╢╘╧≤╡─╖╜╖¿íú
  75. ' ====== -------    ╦ⁿ╩╟ modFriend ╓╨╔∙├≈╡─ DebugInitíóDebugTerm
  76. '   ║═ DebugShow ╡≈╩╘╣²│╠╦∙╥¬╟≤╡─íú
  77. '
  78. Private Property Get IDebug_DebugID() As Long
  79.     IDebug_DebugID = mlngDebugID
  80. End Property
  81.  
  82.