[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

Fixed length string array?

Hello Experts,

I have a fixed length string I would like to put into an array

so for example:

 Dim hello(0) As New VB6.FixedLengthString(15)
 Dim hello(1) As New VB6.FixedLengthString(30)
 Dim hello(2) As New VB6.FixedLengthString(19)

Each string in the array will differ in fixed length...

However visual basic doesn't allow arrays when using fixedlength strings.

Is there any simple way around this?

Thanks Experts.
0
DSLX
Asked:
DSLX
1 Solution
 
ZeonFlashCommented:
I'm not sure why you're using old school FixedLengthStrings (hopefully it's for intefacing with an old VB6 object!), but here's how you can do it in .NET:

        Dim hello(3) As VB6.FixedLengthString

        hello(0) = New VB6.FixedLengthString(15)
        hello(1) = New VB6.FixedLengthString(30)
        hello(2) = New VB6.FixedLengthString(19)
0
 
DSLXAuthor Commented:
That works, exactly what I was looking for thanks :)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now