Home All Groups Group Topic Archive Search About

Silly syntactic question

Author
21 Nov 2007 12:13 PM
guy
My brain is fried, could someone help with this?

I have an array() of object
the second element of the array is also an array() of object


i want to say something like dim a() as object
a= getstuff ' which populates it - this works
dim b() as object
b=a(1) 'this is the problem line
how do I cast this?
b=directcast(a(1),array)
does not work

cheers

Guy

Author
21 Nov 2007 12:23 PM
Phill W.
guy wrote:

> I have an array() of object
> the second element of the array is also an array() of object
>
> i want to say something like dim a() as object
> a = getstuff ' which populates it - this works

> dim b() as object
> b = a(1) ' this is the problem line
> how do I cast this?

b = DirectCast( a(1), Object() )

HTH,
    Phill  W.
Author
21 Nov 2007 12:34 PM
guy
Thanks Phil,that has fixed it

Guy

Show quoteHide quote
"Phill W." wrote:

> guy wrote:
>
> > I have an array() of object
> > the second element of the array is also an array() of object
> >
> > i want to say something like dim a() as object
> > a = getstuff ' which populates it - this works
>
> > dim b() as object
> > b = a(1) ' this is the problem line
> > how do I cast this?
>
> b = DirectCast( a(1), Object() )
>
> HTH,
>     Phill  W.
>
Author
21 Nov 2007 4:29 PM
Herfried K. Wagner [MVP]
"guy" <g**@discussions.microsoft.com> schrieb:
> I have an array() of object
> the second element of the array is also an array() of object
>
>
> i want to say something like dim a() as object
> a= getstuff ' which populates it - this works
> dim b() as object
> b=a(1) 'this is the problem line
> how do I cast this?
> b=directcast(a(1),array)
> does not work

=> 'b = DirectCast(a(1), Object())'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
21 Nov 2007 4:31 PM
Armin Zingler
Show quote Hide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> schrieb
> "guy" <g**@discussions.microsoft.com> schrieb:
> > I have an array() of object
> > the second element of the array is also an array() of object
> >
> >
> > i want to say something like dim a() as object
> > a= getstuff ' which populates it - this works
> > dim b() as object
> > b=a(1) 'this is the problem line
> > how do I cast this?
> > b=directcast(a(1),array)
> > does not work
>
> => 'b = DirectCast(a(1), Object())'.

I wonder, where's the the difference to Phill's answer?


Armin
Author
21 Nov 2007 4:38 PM
Herfried K. Wagner [MVP]
"Armin Zingler" <az.nospam@freenet.de> schrieb:
> I wonder, where's the the difference to Phill's answer?

Sorry, I didn't see his reply because I replied before refreshing the
message list.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
21 Nov 2007 4:44 PM
Armin Zingler
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> schrieb
> "Armin Zingler" <az.nospam@freenet.de> schrieb:
> > I wonder, where's the the difference to Phill's answer?
>
> Sorry, I didn't see his reply because I replied before refreshing
> the message list.

I see. Just because his msg was 4 hours old. :)


Armin
Author
22 Nov 2007 9:00 AM
guy
Germans and Austrians, Austrians and Germans...



Show quoteHide quote
"Armin Zingler" wrote:

> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> schrieb
> > "Armin Zingler" <az.nospam@freenet.de> schrieb:
> > > I wonder, where's the the difference to Phill's answer?
> >
> > Sorry, I didn't see his reply because I replied before refreshing
> > the message list.
>
> I see. Just because his msg was 4 hours old. :)
>
>
> Armin
>