home *** CD-ROM | disk | FTP | other *** search
/ Troubleshooting Netware Systems / CSTRIAL0196.BIN / attach / msj / v10n10 / vb40.exe / EMPLOYNN.EXE / EMPLOYEE.FRM < prev    next >
Text File  |  1995-10-01  |  3KB  |  120 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   3930
  6.    ClientLeft      =   2460
  7.    ClientTop       =   1755
  8.    ClientWidth     =   6240
  9.    Height          =   4410
  10.    Left            =   2385
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   3930
  15.    ScaleWidth      =   6240
  16.    Top             =   1350
  17.    Width           =   6390
  18.    Begin VB.ListBox List2 
  19.       Height          =   2205
  20.       Left            =   2640
  21.       TabIndex        =   5
  22.       Top             =   1680
  23.       Width           =   2295
  24.    End
  25.    Begin VB.ListBox List1 
  26.       Height          =   2205
  27.       Left            =   240
  28.       TabIndex        =   4
  29.       Top             =   1680
  30.       Width           =   2295
  31.    End
  32.    Begin VB.CommandButton Command3 
  33.       Caption         =   "1000 calls"
  34.       Height          =   375
  35.       Left            =   120
  36.       TabIndex        =   0
  37.       Top             =   600
  38.       Width           =   1455
  39.    End
  40.    Begin VB.Line Line1 
  41.       BorderWidth     =   3
  42.       X1              =   120
  43.       X2              =   6120
  44.       Y1              =   360
  45.       Y2              =   360
  46.    End
  47.    Begin VB.Label Label1 
  48.       Caption         =   "CreateObject vs. New"
  49.       BeginProperty Font 
  50.          name            =   "Arial"
  51.          charset         =   1
  52.          weight          =   700
  53.          size            =   14.25
  54.          underline       =   0   'False
  55.          italic          =   -1  'True
  56.          strikethrough   =   0   'False
  57.       EndProperty
  58.       Height          =   375
  59.       Left            =   120
  60.       TabIndex        =   3
  61.       Top             =   0
  62.       Width           =   3135
  63.    End
  64.    Begin VB.Label Label5 
  65.       Height          =   255
  66.       Left            =   1800
  67.       TabIndex        =   2
  68.       Top             =   1200
  69.       Width           =   3255
  70.    End
  71.    Begin VB.Label Label4 
  72.       Height          =   255
  73.       Left            =   1800
  74.       TabIndex        =   1
  75.       Top             =   720
  76.       Width           =   3255
  77.    End
  78. End
  79. Attribute VB_Name = "Form1"
  80. Attribute VB_Creatable = False
  81. Attribute VB_Exposed = False
  82. Private Sub Command3_Click()
  83. Dim Emp As New Employee
  84. Dim Emp2 As Object
  85.  
  86. For x = 1 To 10
  87.  
  88.     ' Method one - calls using the New keyword
  89.  
  90.     Emp.Weight = 200
  91.  
  92.     Start = Timer   ' Set start time.
  93.  
  94.     For n = 1 To 1000
  95.         Emp.AddPounds (1)
  96.     Next n
  97.  
  98.     Finish = Timer  ' Set end time.
  99.  
  100.     List1.AddItem " " & (Finish - Start) & " secs."
  101.  
  102.     ' Method two - calls using a late-bound Object
  103.  
  104.     Set Emp2 = CreateObject("MSJEmployee.Employee")
  105.     Emp2.Weight = 200
  106.  
  107.     Start = Timer   ' Set start time.
  108.  
  109.     For n = 1 To 1000
  110.         Emp2.AddPounds (1)
  111.     Next n
  112.  
  113.     Finish = Timer  ' Set end time.
  114.  
  115.     List2.AddItem " " & (Finish - Start) & " secs."
  116.  
  117. DoEvents
  118. Next x
  119. End Sub
  120.