|
-
Dec 24th, 2003, 12:18 AM
#1
Thread Starter
Frenzied Member
are these statements the same? [RESOLVED]
dim myGraphicsPath as graphicsPath
myGraphicsPath = new GraphicsPath()
is this more easily written as...
dim myGraphicsPath as New GraphicsPath
????????????????????????????????
seems like the same to me anyway.
Last edited by Andy; Dec 29th, 2003 at 03:10 AM.
-
Dec 24th, 2003, 01:15 AM
#2
-
Dec 24th, 2003, 02:52 AM
#3
Thread Starter
Frenzied Member
-
Dec 24th, 2003, 04:01 AM
#4
Sleep mode
Originally posted by thephantom
dim myGraphicsPath as graphicsPath
myGraphicsPath = new GraphicsPath()
is this more easily written as...
dim myGraphicsPath as New GraphicsPath
????????????????????????????????
seems like the same to me anyway.
Well , yes the same but not 100% the same . Consider this :
VB Code:
dim myGraphicsPath as graphicsPath
myGraphicsPath = new GraphicsPath()
CLR do this :
1-Reserve memory for myGraphicsPath and assign it a name .
2-Here , myGraphicsPath is actually created and filled in the memory allocated and ready to be accessed .
VB Code:
dim myGraphicsPath as New GraphicsPath
1-Reserve memory , assigne it a name , and immediately create the object inside it .
This made some performance problems in previous VB versions but as MS says , it's optimized in .NET .
Personally , I like one-step declaration .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|