Re: 2D array
Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance
if your data looks like this
column1 column2
a 1
b 2
c 3
then
strAnswer[0,0] = "a";
strAnswer[0,1] = "1";
strAnswer[1,0] = "b";
strAnswer[1,1] = "2";
strAnswer[2,0] = "b";
strAnswer[2,1] = "3";
so, [value,value] means [rowindex, columnindex]
"Andrew" <Andrew@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:43CA2C8E-64BE-4FE7-A832-BCD3E0A0BCDA@xxxxxxxxxxxxxxxx
> How do I declare and ADD to a 2D array ?
>
> I declared it as:
> string[,] stdAnswer = new String[2,50];
>
> Usually in a 1D array, adding would be done by:
> ArrayList values = new ArrayList();
> values.Add ("IN");
>
> TIA.
.
Relevant Pages
- Re: Passing an array of structuresfrom a pointer?
... to only declare structs in headers and then define the ... the struct should be declared ... what if you have a simple array like this: ... In the header we would declare? ... (microsoft.public.vc.language) - Re: vb.net class
... about fixed array lenghts or using ReDim statements. ... code ensures everything in the array is a String because you declare it ... Count can be generated from the time list, not need to store ... (microsoft.public.dotnet.languages.vb) - Re: Scope of Variant / Array
... Even though you declared the array "public" in the main (parent) form, ... a form code module is the same as a class module. ... Constants, fixed-length strings, arrays, user-defined types and Declare ... (microsoft.public.access.formscoding) - Re: ReDim not working as expected. Array expert needed.
... Any dimensions you declare your variable in are wiped out, ... variable as a variant, I next told you not to redim it. ... examples of how array dimensions work in VBA. ... (microsoft.public.excel.programming) - Re: Looking to improve program
... You generally should declare your variables in the smallest scope ... array. ... Now that you have the hash, you can use it instead of four nearly ... There's also no real reason to be assigning ... (comp.lang.perl.misc) |
|