Re: Collections
From: Ravichandran J.V. (jvravichandran_at_yahoo.com)
Date: 03/24/04
- Next message: Howard Kaikow: "Re: will VB.net work on pentium 1?"
- Previous message: Howard Kaikow: "Re: will VB.net work on pentium 1?"
- In reply to: Jay B. Harlow [MVP - Outlook]: "Re: Collections"
- Next in thread: Jay B. Harlow [MVP - Outlook]: "Re: Collections"
- Reply: Jay B. Harlow [MVP - Outlook]: "Re: Collections"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 23 Mar 2004 23:10:42 -0800
Dim i As Integer
Dim s As String
Dim o As Object
s = "123"
o = s
i = CType(o, Integer) ' succeeds
i = DirectCast(o, Integer) ' fails
There is not so much to be talked abt if you talk of converting an
inbuilt type to another as in your example above. Try casting into a
user-defined class which is modified as MustInherit(if you are VB
oriented) and obtain it through inheritance into another class. Then,
try DiectCast to cast a normal class to that of the MustInherit class
and it will work till the exception is thrown at runtime. Whereas, in
the same scenario, CType will show you an error before compile time. I
am of course talking in terms of VS.Net Ide.
By the way, since you are a MVP-Outlook, I am asking this question. When
I try to switch my identity in Outlook Express 5.0 after having added a
new identity, why does the switch not take place ?
with regards,
J.V.Ravichandran
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
at http://www.Google.com
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
- Next message: Howard Kaikow: "Re: will VB.net work on pentium 1?"
- Previous message: Howard Kaikow: "Re: will VB.net work on pentium 1?"
- In reply to: Jay B. Harlow [MVP - Outlook]: "Re: Collections"
- Next in thread: Jay B. Harlow [MVP - Outlook]: "Re: Collections"
- Reply: Jay B. Harlow [MVP - Outlook]: "Re: Collections"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|