Newby question

B

Boni

Hi,
How do I create an array of 2 to object pointers?
i.e.
dim a as object(2)
Thanks,
Boni
 
A

Armin Zingler

Boni said:
Hi,
How do I create an array of 2 to object pointers?
i.e.
dim a as object(2)
Thanks,
Boni

An array being able to point to two object?

dim a(1) as object '1=upper bound

a(0) = new object
a(1) = new object




Armin
 
J

Jonathan Allen

dim a(1) as object '1=upper bound

A side note, that line used to be written as...

dim a(0 to 1) as object

If you think of it that way, it is easier to remember that 1 is the upper
bound and not the row count.
 
H

Herfried K. Wagner [MVP]

Jonathan Allen said:
A side note, that line used to be written as...

dim a(0 to 1) as object

If you think of it that way, it is easier to remember that 1 is the upper
bound and not the row count.

That's why VB 2005 will support the '... To ...' syntax for arrays again,
however, the lower bound must be zero.
 
J

Jonathan Allen

That's why VB 2005 will support the '... To ...' syntax for arrays again,
however, the lower bound must be zero.

That sort of defeats the purpose of changing the syntax. But maybe in 2007
we will get control over lower bounds again. I know it is rarely used in
good code, but in there are rare cases where it helps a lot.
 

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

Similar Threads


Top