Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dim MyObject As New ... vs. Set MyObject = New ...
Message
From
26/08/1999 17:29:12
 
 
To
All
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Title:
Dim MyObject As New ... vs. Set MyObject = New ...
Miscellaneous
Thread ID:
00258165
Message ID:
00258165
Views:
47
Can anyone tell me what difference there is (other than 1 line of code) between using the New keyword in a Dim statement, or in a Set statement? For instance:

Public Sub MyFunc()
Dim MyObject1 As New MyClass()
Dim MyObject2 As MyClass()

'Class Instance Created Here for MyObject1
MyObject1.MyValue = "Some Value"

'Class Instance Created Here for MyObject2
Set MyObject2 = New MyClass
MyObject2.MyValue = "Some Other Value"
End Sub

Thanks,
-Mike
--------------------------
Michael Koepke, Consultant
Nims Associates, Inc.
mkkoepke@aol.com
Next
Reply
Map
View

Click here to load this message in the networking platform