Newbie Question: Dim A() as String /Dim A as String() 
Author Message
 Newbie Question: Dim A() as String /Dim A as String()

This is a question with what is probably a very simple answer but after
stopping at Borders and looking at half a dozen books trying to find one
that explained this, I'm desparate.

I believe that when my code states:

dim A() as String

I'm declaring an array A of string values.

What then does the following code do?

dim A as String()

Thanks.

Art



Sun, 24 Jul 2005 10:03:07 GMT  
 Newbie Question: Dim A() as String /Dim A as String()
: This is a question with what is probably a very simple answer but after
: stopping at Borders and looking at half a dozen books trying to find one
: that explained this, I'm desparate.
:
: I believe that when my code states:
:
: dim A() as String
:
: I'm declaring an array A of string values.
:
: What then does the following code do?
:
: dim A as String()
:
: Thanks.
:
: Art
:

Exactly the same thing, the only difference is semantics, ie

Dim A() As String is saying create an array called A and and make it hold
strings
where as
Dim A As String() is saying create a variable called A and make it an array
of strings.

As you can see it's exactly the same. At least that's how I understand it.

HTH



Sun, 24 Jul 2005 10:34:11 GMT  
 Newbie Question: Dim A() as String /Dim A as String()
If you find yourself using arrays of strings often. You might want to check
out the StringCollection object in System.Collections.Specialized.

--
Daniel Okely
dbokely at yahoo.com.au


Quote:
> : This is a question with what is probably a very simple answer but after
> : stopping at Borders and looking at half a dozen books trying to find one
> : that explained this, I'm desparate.
> :
> : I believe that when my code states:
> :
> : dim A() as String
> :
> : I'm declaring an array A of string values.
> :
> : What then does the following code do?
> :
> : dim A as String()
> :
> : Thanks.
> :
> : Art
> :

> Exactly the same thing, the only difference is semantics, ie

> Dim A() As String is saying create an array called A and and make it hold
> strings
> where as
> Dim A As String() is saying create a variable called A and make it an
array
> of strings.

> As you can see it's exactly the same. At least that's how I understand it.

> HTH



Sat, 30 Jul 2005 17:38:33 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. dim string to dim form

2. Dim pages(,) As String?

3. Dim for strings ? (qbasic)

4. Odd Behavior re: dim as string and then input

5. Efficient use of strings (Dim, Redim, and all that)

6. Dim xxxx AS String * 30

7. Dim a Variable from a string???Possible??

8. Dim a string to a fixed size during runtime

9. Dim a Variable from a string???Possible??

10. Dim a Variable from a string???Possible??

11. Dim obj As New Class crt Dim Obj As Class = New Class

12. dynamically dim a variable ie dim "variable"&n

 

 
Powered by phpBB® Forum Software