home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Troubleshooting Netware Systems
/
CSTRIAL0196.BIN
/
attach
/
msj
/
v10n10
/
vb40.exe
/
EMPLOYNN.EXE
/
EMPLOYEE.FRM
< prev
next >
Wrap
Text File
|
1995-10-01
|
3KB
|
120 lines
VERSION 4.00
Begin VB.Form Form1
BorderStyle = 3 'Fixed Dialog
Caption = "Form1"
ClientHeight = 3930
ClientLeft = 2460
ClientTop = 1755
ClientWidth = 6240
Height = 4410
Left = 2385
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3930
ScaleWidth = 6240
Top = 1350
Width = 6390
Begin VB.ListBox List2
Height = 2205
Left = 2640
TabIndex = 5
Top = 1680
Width = 2295
End
Begin VB.ListBox List1
Height = 2205
Left = 240
TabIndex = 4
Top = 1680
Width = 2295
End
Begin VB.CommandButton Command3
Caption = "1000 calls"
Height = 375
Left = 120
TabIndex = 0
Top = 600
Width = 1455
End
Begin VB.Line Line1
BorderWidth = 3
X1 = 120
X2 = 6120
Y1 = 360
Y2 = 360
End
Begin VB.Label Label1
Caption = "CreateObject vs. New"
BeginProperty Font
name = "Arial"
charset = 1
weight = 700
size = 14.25
underline = 0 'False
italic = -1 'True
strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 3
Top = 0
Width = 3135
End
Begin VB.Label Label5
Height = 255
Left = 1800
TabIndex = 2
Top = 1200
Width = 3255
End
Begin VB.Label Label4
Height = 255
Left = 1800
TabIndex = 1
Top = 720
Width = 3255
End
End
Attribute VB_Name = "Form1"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Private Sub Command3_Click()
Dim Emp As New Employee
Dim Emp2 As Object
For x = 1 To 10
' Method one - calls using the New keyword
Emp.Weight = 200
Start = Timer ' Set start time.
For n = 1 To 1000
Emp.AddPounds (1)
Next n
Finish = Timer ' Set end time.
List1.AddItem " " & (Finish - Start) & " secs."
' Method two - calls using a late-bound Object
Set Emp2 = CreateObject("MSJEmployee.Employee")
Emp2.Weight = 200
Start = Timer ' Set start time.
For n = 1 To 1000
Emp2.AddPounds (1)
Next n
Finish = Timer ' Set end time.
List2.AddItem " " & (Finish - Start) & " secs."
DoEvents
Next x
End Sub