Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CType() in VB.NET
Message
De
12/05/2005 00:00:02
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01013227
Message ID:
01013261
Vues:
14
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform