Guest learn Posted September 4, 2002 Posted September 4, 2002 Hi, Can you tell me when we deed to use 'New' Dim New ... or just Dim? Quote
gallicus Posted September 4, 2002 Posted September 4, 2002 I think when you use New when Dimming an object it actually creates an instance of that object all in one line, as opposed to VB6 when you would two lines: Dim Object as Object Set Object as new Object Quote
Guest learn Posted September 4, 2002 Posted September 4, 2002 'One line' can also be used in VB6, for example: Dim c As New Collection c.Add ("1234") Print c(1) Quote
gallicus Posted September 4, 2002 Posted September 4, 2002 Yes it can, but not for objects. It depends on whether you are declaring variables objects. Our company has moved over to C# now as it's .Net language of choice. I must spend sometime to check out VB.Net too! :) Quote
reboot Posted September 4, 2002 Posted September 4, 2002 You Set object = New object Set object As New object is a syntax error Quote
*Gurus* divil Posted September 5, 2002 *Gurus* Posted September 5, 2002 Except there is no Set keyword in VB.NET. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.