[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...:blush:
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.
Re: [2.0] Trouble porting C# code to VB
Re: [2.0] Trouble porting C# code to VB
Something like
Code:
Dim fill As FillPrimitive = DirectCast(Me.examplesCrs.CrsElement.Children(0), FillPrimitive)