Hello,
I have this array:
Dim myArray() As String = {"A", "B", "C", "D", "E", "F"}
However I need to declare the array and assign the values in different
places of my code so I have:
Dim myArray() As String
....
myArray() = {"A", "B", "C", "D", "E", "F"}
The second line not working.
Can someone tell me why?
Thanks,
Miguel 4 1245
You have to give your array a size or initial values then assign values
using index...
in [C#]
string[] myArray = new string[size];
or
string[] myArray = {"A","B","C"};
then use the index to assign values..
myArray[0] = "A";
myArray[1] = "B";
.................................................. ......
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:O8*************@TK2MSFTNGP12.phx.gbl... Hello,
I have this array:
Dim myArray() As String = {"A", "B", "C", "D", "E", "F"}
However I need to declare the array and assign the values in different places of my code so I have:
Dim myArray() As String ... myArray() = {"A", "B", "C", "D", "E", "F"}
The second line not working.
Can someone tell me why?
Thanks, Miguel
Yes, I can. And I did. Twice now. In detail. See your previous post.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:O8*************@TK2MSFTNGP12.phx.gbl... Hello,
I have this array:
Dim myArray() As String = {"A", "B", "C", "D", "E", "F"}
However I need to declare the array and assign the values in different places of my code so I have:
Dim myArray() As String ... myArray() = {"A", "B", "C", "D", "E", "F"}
The second line not working.
Can someone tell me why?
Thanks, Miguel
Thanks,
There was some mistake in my code I didn't see.
Thanks,
Miguel
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:ke***@DIESPAMMERSDIEtakempis.com: Yes, I can. And I did. Twice now. In detail. See your previous post.
-- HTH,
Kevin Spencer Microsoft MVP .Net Developer Sometimes you eat the elephant. Sometimes the elephant eats you.
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message news:O8*************@TK2MSFTNGP12.phx.gbl...
Hello,
I have this array:
Dim myArray() As String = {"A", "B", "C", "D", "E", "F"}
However I need to declare the array and assign the values in different places of my code so I have:
Dim myArray() As String ... myArray() = {"A", "B", "C", "D", "E", "F"}
The second line not working.
Can someone tell me why?
Thanks, Miguel
No problemo, Miguel. We all need a second pair of eyes now and then!
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:eP**************@TK2MSFTNGP09.phx.gbl... Thanks,
There was some mistake in my code I didn't see.
Thanks, Miguel
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message news:ke***@DIESPAMMERSDIEtakempis.com:
Yes, I can. And I did. Twice now. In detail. See your previous post.
-- HTH,
Kevin Spencer Microsoft MVP .Net Developer Sometimes you eat the elephant. Sometimes the elephant eats you.
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message news:O8*************@TK2MSFTNGP12.phx.gbl...
> Hello, > > I have this array: > > Dim myArray() As String = {"A", "B", "C", "D", "E", "F"} > > However I need to declare the array and assign the values in different > places of my code so I have: > > Dim myArray() As String > ... > myArray() = {"A", "B", "C", "D", "E", "F"} > > The second line not working. > > Can someone tell me why? > > Thanks, > Miguel > > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rafi Kfir |
last post by:
Hi,
This may look as a smiple task to most of you, but to me (a beginner
with C), it drives me crazy.
All I want is that one function passes a two dimensional array of
strings to another...
|
by: Sam |
last post by:
Hello all
I have a two dimensional array (the dimensions are not known) that
needs to be passed
to fortran from c++, allocate the dimensions of the array in fortran
code, do some filling up
of...
|
by: joshc |
last post by:
Hi,
I have an array defined in one file with an intializer as follows:
int arr = {0, 1, 2, 3};
I have a declaration of the array in another file as follows:
extern int arr;
|
by: Michael |
last post by:
Hi,
I am trying to pass a function an array of strings, but I am having trouble
getting the indexing to index the strings rather than the individual
characters of one of the strings.
I have...
|
by: DarelRex |
last post by:
Is it possible to pass a 2-D, statically defined array?
Here's a 1-D example that won't work:
void foo() {
int myArray ;
bar(myArray);
}
void bar(int *arr) {
|
by: buuuuuum |
last post by:
why array can't be assigned, like structs?
|
by: mdh |
last post by:
>From p112 ( K&R).
Given an array declared as
static char arr= { { 0,1,........},{0,1,.....}};
let arr be passed as an argument to f.
f( int (*arr) ) {....}
It is noted that the...
|
by: Imran |
last post by:
Hello all, I am trying to pass 2D array to a func, as follows, it is showing
compiler error.
void helloptr(int **a){
a = 0xB;
}
int main(int argc, char* argv){
|
by: mdh |
last post by:
I am still having a problem understanding K&RII on p 112. I have
looked at the FAQs --which I am sure answer it in a way that I have
missed, so here goes.
A 2-dim array, (per K&R) is really a...
|
by: Peskov Dmitry |
last post by:
class simple_class
{
int data;
public:
simple_class() {data=10;};
simple_class(int val) : data(val){}
};
int main()
{
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |