Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CType() in VB.NET
Message
From
12/05/2005 00:00:02
Keith Payne
Technical Marketing Solutions
Florida, United States
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01013227
Message ID:
01013261
Views:
13
>Bonnie,
>Thanks for your reply. I have been reading a lot of VB.NET code lately, mostly to learn more about VB.NET (even if C# is my language of choice). I found this little piece of information in the M$ docs about CType() kind of odd:
>
>CType is compiled inline, meaning the conversion code is part of the code that evaluates the expression.
>Execution is faster because there is no call to a procedure to accomplish the conversion.
>
>
>Execution is faster compared to what? CType() is explicitly converting an object to another object, is casting in C# (also explicitly converting) slower than CType() in VB.NET?
>
>
>
>Einar
>

I believe the docs are referring to the speed difference between implicit and explicit casting in VB.NET. Also in VB.NET is the nifty keyword DirectCast. DirectCast does not perform error checking, so it is faster than both CType() and implicit casting.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform