Convert VB6 To Vb.Net

Can you tell me how to convert the VB6 code
Dim Param(7) As String * 8

To Vb.Net

Its an fixed length array of fixed length stings
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


Fixed length strings are not really supported in VB.NET - only via a VB6 backwards compatibility class that provides that behaviour.

Have a look here, above half way down the page, titled "Arrays and Fixed-Length Strings in User-Defined Types":

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Here is a simple way that you may want to play with....

        Dim P As String = String.Empty
        Dim Param As New ArrayList

        For x As Integer = 0 To 7
I was thinking last night you can do this also

It is rare that anybody uses fixed sizes any more.
So you could do a regular array and then pad the different in the length of the array item.
  Private Function CheckFixLength(ByVal Str As String) As String
        If Str.Length < 8 Then
            Return Str.PadRight(8)
        ElseIf Str.Length > 8 Then
            Return Str.Substring(0, 8)
        End If
        Return Nothing
    End Function
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.