|
-
Dec 30th, 2008, 05:54 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] [2.0] Trouble porting C# code to VB
I was recently tasked the difficult job of porting some C# code to VB. I have no experience in writing C# code however I am comfortable with .NET and VB. So far I have successfully ported most of the code, however the following line puzzles me:
Code:
FillPrimitive fill = (FillPrimitive)this.examplesCrs.CrsElement.Children[0];
How would I port this to VB? The FillPrimitive part in parentheses puzzles me...
Last edited by obi1kenobi; Dec 31st, 2008 at 07:31 AM.
Please rate helpful ppl's posts. It's the best 'thank you' you can give 
-
Dec 30th, 2008, 06:37 PM
#2
Re: [2.0] Trouble porting C# code to VB
That is an explicit cast, which is done in VB with DirectCast.
By the way, they are parentheses, not brackets. The index 0 at the end of the line is in brackets.
-
Dec 31st, 2008, 07:07 AM
#3
Thread Starter
Frenzied Member
Re: [2.0] Trouble porting C# code to VB
Please rate helpful ppl's posts. It's the best 'thank you' you can give 
-
Dec 31st, 2008, 07:31 AM
#4
Re: [2.0] Trouble porting C# code to VB
Something like
Code:
Dim fill As FillPrimitive = DirectCast(Me.examplesCrs.CrsElement.Children(0), FillPrimitive)
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
|