Array Syntax

S

Samuel Shulman

I have an array of Object type

I want to assign to each element of the array a 2D String array so I tried to assign like this:
= New String(2, 2) but the compiler assumes these are constructor parameter

How can I achieve that?

Samuel
 
J

Jay B. Harlow [MVP - Outlook]

Samuel,
Include {} on the end on the string array initialization, something like:

Dim mess(3) as Object
mess(0) = New String(2, 2) {}
mess(1) = New String(2, 2) {}
mess(2) = New String(2, 2) {}
mess(3) = New String(2, 2) {}

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


I have an array of Object type

I want to assign to each element of the array a 2D String array so I tried
to assign like this:
= New String(2, 2) but the compiler assumes these are constructor parameter

How can I achieve that?

Samuel
 

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

Top