473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Array Syntax

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

Aug 20 '06 #1
2 896
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
"Samuel Shulman" <sa************@ntlworld.comwrote in message
news:eh**************@TK2MSFTNGP04.phx.gbl...
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
Aug 20 '06 #2
Thank you,

Samuel
"Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.netwrote in
message news:%2****************@TK2MSFTNGP06.phx.gbl...
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
"Samuel Shulman" <sa************@ntlworld.comwrote in message
news:eh**************@TK2MSFTNGP04.phx.gbl...
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


Aug 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: truckaxle | last post by:
I am trying to pass a slice from a larger 2-dimensional array to a function that will work on a smaller region of the array space. The code below is a distillation of what I am trying to...
15
by: Geoff Cox | last post by:
Hello, Can I separately declare and initialize a string array? How and where would I do it in the code below? It was created using Visual C++ 2005 Express Beta 2 ... In C# I would have ...
4
by: bienwell | last post by:
Hi all, Data displayed on the datalist control is bound by the column name of the dataset like this : <%# DataBinder.Eval(Container.DataItem, "title")%> Could I use an element of the array...
4
by: Alan Foxmore | last post by:
Hi everyone, I'm new to C# and I was hoping I could get some clarification on the syntax for jagged and multidimensional arrays. Here is my question: The following syntax is correct for...
7
by: Sam Kong | last post by:
Hello! My question would not be very practical but just out of curiosity. In JavaScript, Array is a subclass of Object. Well maybe not exactly... but sort of... For normal objects, you can...
9
by: amygdala | last post by:
Hi, I'm trying to assign values to an array by evaluating expressions like so: $myArray = ( 'sessionMaxInactive' =60*5, 'persistentMaxTime' =60*60*24*30 ); This doesn't seem to work. I've...
2
by: JJA | last post by:
I'm looking at some code I do not understand: var icons = new Array(); icons = new GIcon(); icons.image = "somefilename.png"; I read this as an array of icons is being built. An element of...
272
by: Peter Olcott | last post by:
http://groups.google.com/group/comp.lang.c++/msg/a9092f0f6c9bf13a I think that the operator() member function does not work correctly, does anyone else know how to make a template for making two...
5
by: latin & geek via DotNetMonster.com | last post by:
dear all, hi. i have a little sub routine which works fine in my dummy test program, but when i insert it in my main program it throws errors. this is the subroutine: Public Sub...
17
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hi Gurus, I need to transfer a jagged array of byte by reference to unmanaged function, The unmanaged code should changed the values of the array, and when the unmanaged function returns I need...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.