Convert this code to vb?

E

eagle

How can I convert this c# (?) procedure to vb? I get everything but the
byte conversion:

byte[] buff = new byte[size];


Thank your for your help
 
J

Juan T. Llibre

http://www.eggheadcafe.com/articles/cstovbweb/converter.aspx

Says it is :
Dim buff(size) As Byte

http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx

Says it is :
Private buff As Byte() = New Byte(size) {}

http://www.carlosag.net/Tools/CodeTranslator/default.aspx

Says it is :
Dim buff() As Byte = New Byte((size) - 1) {}

Test them all and take your pick.
Online converters are quite useful.




Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
 
G

Guest

Assuming this is internal to a method, using Instant VB:
Dim buff As Byte() = New Byte(size - 1){}

Note that in VB you specify the upper bound when sizing an array, unlike in
C# where the length is specified, so the "- 1" here is necessary.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top