Home All Groups Group Topic Archive Search About
Author
18 Aug 2006 4:01 PM
Miro
VB 2003 and Im still new to vb, so i hope i can explain this as best I can.

I have a variable defined as such: ( simple example )

        Dim AVariableOfSorts(,) As Object = _
            { _
                {"Last", "String", 20}, _
                {"First", "String", 20} _
            }


I had to define it as an object so I can have different variable types all
within the same array.
( unless there is another way to do this )

What im getting is an error  "Option Strict On Disallows Late Binding" when
I try to do anything with an array element.

For example
AVariableOfSorts(1, 1) = ""

I would like to keep Strict On on

What am I missing ? or how do I get around this issue?

I beleive I know the difference between binding.  - Simply put:
1.  Dim X as String  is early binding   and  Dim X as Object  ,...
X.GetType.ToString  would be late binding and would
take longer during running.

Im not sure what to search for in Help / or Online to help myself out.

Thanks

Miro

Author
18 Aug 2006 5:48 PM
Herfried K. Wagner [MVP]
Show quote Hide quote
"Miro" <miron***@golden.net> schrieb:
> VB 2003 and Im still new to vb, so i hope i can explain this as best I
> can.
>
> I have a variable defined as such: ( simple example )
>
>        Dim AVariableOfSorts(,) As Object = _
>            { _
>                {"Last", "String", 20}, _
>                {"First", "String", 20} _
>            }
>
>
> I had to define it as an object so I can have different variable types all
> within the same array.
> ( unless there is another way to do this )
>
> What im getting is an error  "Option Strict On Disallows Late Binding"
> when I try to do anything with an array element.
>
> For example
> AVariableOfSorts(1, 1) = ""
>
> I would like to keep Strict On on

\\\
DirectCast(AVariableOfSorts(1, 1), String) = ""
///

> What am I missing ? or how do I get around this issue?

Maybe it's better to define a class with properties for the first and second
string and the integer number.  Then you can create an array of this type
('Dim Items() As Foo').

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
18 Aug 2006 6:49 PM
rmacias
You can try using an ArrayList

Dim listOfObjs As ArrayList = New ArrayList

listOfObjs.Add("Last")
listOfObjs.Add("String")
listOfObjs.Add("20")

However, I like Herfried's idea better in creating a class for this
information and then having an array (or a strongly typed collection) for
them.  It really depends on what you are trying to accomplish.

Show quoteHide quote
"Miro" wrote:

> VB 2003 and Im still new to vb, so i hope i can explain this as best I can.
>
> I have a variable defined as such: ( simple example )
>
>         Dim AVariableOfSorts(,) As Object = _
>             { _
>                 {"Last", "String", 20}, _
>                 {"First", "String", 20} _
>             }
>
>
> I had to define it as an object so I can have different variable types all
> within the same array.
> ( unless there is another way to do this )
>
> What im getting is an error  "Option Strict On Disallows Late Binding" when
> I try to do anything with an array element.
>
> For example
> AVariableOfSorts(1, 1) = ""
>
> I would like to keep Strict On on
>
> What am I missing ? or how do I get around this issue?
>
> I beleive I know the difference between binding.  - Simply put:
> 1.  Dim X as String  is early binding   and  Dim X as Object  ,...
> X.GetType.ToString  would be late binding and would
> take longer during running.
>
> Im not sure what to search for in Help / or Online to help myself out.
>
> Thanks
>
> Miro
>
>
>
>
Author
18 Aug 2006 7:12 PM
tommaso.gastaldi
Yes Herfried is right. Go for a class anc collections. Forget about
bidimensional arrays of objects. I have never seen them in a meaningul
..net program.

tommaso

rmacias ha scritto:

Show quoteHide quote
> You can try using an ArrayList
>
> Dim listOfObjs As ArrayList = New ArrayList
>
> listOfObjs.Add("Last")
> listOfObjs.Add("String")
> listOfObjs.Add("20")
>
> However, I like Herfried's idea better in creating a class for this
> information and then having an array (or a strongly typed collection) for
> them.  It really depends on what you are trying to accomplish.
>
> "Miro" wrote:
>
> > VB 2003 and Im still new to vb, so i hope i can explain this as best I can.
> >
> > I have a variable defined as such: ( simple example )
> >
> >         Dim AVariableOfSorts(,) As Object = _
> >             { _
> >                 {"Last", "String", 20}, _
> >                 {"First", "String", 20} _
> >             }
> >
> >
> > I had to define it as an object so I can have different variable types all
> > within the same array.
> > ( unless there is another way to do this )
> >
> > What im getting is an error  "Option Strict On Disallows Late Binding" when
> > I try to do anything with an array element.
> >
> > For example
> > AVariableOfSorts(1, 1) = ""
> >
> > I would like to keep Strict On on
> >
> > What am I missing ? or how do I get around this issue?
> >
> > I beleive I know the difference between binding.  - Simply put:
> > 1.  Dim X as String  is early binding   and  Dim X as Object  ,...
> > X.GetType.ToString  would be late binding and would
> > take longer during running.
> >
> > Im not sure what to search for in Help / or Online to help myself out.
> >
> > Thanks
> >
> > Miro
> >
> >
> >
> >
Author
18 Aug 2006 8:45 PM
Miro
Ive never used classes in the programming languages ive used.

So that is my next lesson.
I stayed away from the array lists cause I didnt like how all the items have
to be the same "var type "

I just want to store a whole bunch of data in 1 variable with many different
vartypes and change the
variable elements as i need to.

Someone once pointed me on this newgroup to the object, so now im at the
point to use the "object" var
i created and im running into this.

So a class it will be - as long as i can achieve the above posted.
I can always make something like  "dim bla(,) as String" and strigify
everything and val it as i need to cause i know
which elements are going to be numeric.
I just didnt  think it would be this hard to store different variable types
/ variables all in one array.

So im off to read about classes .... my next post might be about them :)

Thanks.

<tommaso.gasta***@uniroma1.it> wrote in message
Show quoteHide quote
news:1155928323.990675.126610@m79g2000cwm.googlegroups.com...
> Yes Herfried is right. Go for a class anc collections. Forget about
> bidimensional arrays of objects. I have never seen them in a meaningul
> .net program.
>
> tommaso
>
> rmacias ha scritto:
>
>> You can try using an ArrayList
>>
>> Dim listOfObjs As ArrayList = New ArrayList
>>
>> listOfObjs.Add("Last")
>> listOfObjs.Add("String")
>> listOfObjs.Add("20")
>>
>> However, I like Herfried's idea better in creating a class for this
>> information and then having an array (or a strongly typed collection) for
>> them.  It really depends on what you are trying to accomplish.
>>
>> "Miro" wrote:
>>
>> > VB 2003 and Im still new to vb, so i hope i can explain this as best I
>> > can.
>> >
>> > I have a variable defined as such: ( simple example )
>> >
>> >         Dim AVariableOfSorts(,) As Object = _
>> >             { _
>> >                 {"Last", "String", 20}, _
>> >                 {"First", "String", 20} _
>> >             }
>> >
>> >
>> > I had to define it as an object so I can have different variable types
>> > all
>> > within the same array.
>> > ( unless there is another way to do this )
>> >
>> > What im getting is an error  "Option Strict On Disallows Late Binding"
>> > when
>> > I try to do anything with an array element.
>> >
>> > For example
>> > AVariableOfSorts(1, 1) = ""
>> >
>> > I would like to keep Strict On on
>> >
>> > What am I missing ? or how do I get around this issue?
>> >
>> > I beleive I know the difference between binding.  - Simply put:
>> > 1.  Dim X as String  is early binding   and  Dim X as Object  ,...
>> > X.GetType.ToString  would be late binding and would
>> > take longer during running.
>> >
>> > Im not sure what to search for in Help / or Online to help myself out.
>> >
>> > Thanks
>> >
>> > Miro
>> >
>> >
>> >
>> >
>
Author
18 Aug 2006 9:01 PM
tommaso.gastaldi
Hi Miro. This is not a poetry.

Classes must be your breath.

Arraylist, Hashtable, Sorted List,
your father, mother and brother.

Comparers your best friends ...

Anyone wants to add more lines ?  :)

Tommaso


Miro ha scritto:

Show quoteHide quote
> Ive never used classes in the programming languages ive used.
>
> So that is my next lesson.
> I stayed away from the array lists cause I didnt like how all the items have
> to be the same "var type "
>
> I just want to store a whole bunch of data in 1 variable with many different
> vartypes and change the
> variable elements as i need to.
>
> Someone once pointed me on this newgroup to the object, so now im at the
> point to use the "object" var
> i created and im running into this.
>
> So a class it will be - as long as i can achieve the above posted.
> I can always make something like  "dim bla(,) as String" and strigify
> everything and val it as i need to cause i know
> which elements are going to be numeric.
> I just didnt  think it would be this hard to store different variable types
> / variables all in one array.
>
> So im off to read about classes .... my next post might be about them :)
>
> Thanks.
>
> <tommaso.gasta***@uniroma1.it> wrote in message
> news:1155928323.990675.126610@m79g2000cwm.googlegroups.com...
> > Yes Herfried is right. Go for a class anc collections. Forget about
> > bidimensional arrays of objects. I have never seen them in a meaningul
> > .net program.
> >
> > tommaso
> >
> > rmacias ha scritto:
> >
> >> You can try using an ArrayList
> >>
> >> Dim listOfObjs As ArrayList = New ArrayList
> >>
> >> listOfObjs.Add("Last")
> >> listOfObjs.Add("String")
> >> listOfObjs.Add("20")
> >>
> >> However, I like Herfried's idea better in creating a class for this
> >> information and then having an array (or a strongly typed collection) for
> >> them.  It really depends on what you are trying to accomplish.
> >>
> >> "Miro" wrote:
> >>
> >> > VB 2003 and Im still new to vb, so i hope i can explain this as best I
> >> > can.
> >> >
> >> > I have a variable defined as such: ( simple example )
> >> >
> >> >         Dim AVariableOfSorts(,) As Object = _
> >> >             { _
> >> >                 {"Last", "String", 20}, _
> >> >                 {"First", "String", 20} _
> >> >             }
> >> >
> >> >
> >> > I had to define it as an object so I can have different variable types
> >> > all
> >> > within the same array.
> >> > ( unless there is another way to do this )
> >> >
> >> > What im getting is an error  "Option Strict On Disallows Late Binding"
> >> > when
> >> > I try to do anything with an array element.
> >> >
> >> > For example
> >> > AVariableOfSorts(1, 1) = ""
> >> >
> >> > I would like to keep Strict On on
> >> >
> >> > What am I missing ? or how do I get around this issue?
> >> >
> >> > I beleive I know the difference between binding.  - Simply put:
> >> > 1.  Dim X as String  is early binding   and  Dim X as Object  ,...
> >> > X.GetType.ToString  would be late binding and would
> >> > take longer during running.
> >> >
> >> > Im not sure what to search for in Help / or Online to help myself out.
> >> >
> >> > Thanks
> >> >
> >> > Miro
> >> >
> >> >
> >> >
> >> >
> >
Author
18 Aug 2006 10:28 PM
Miro
Believe it or not they arent the easiest thing to grasp.

In theory or on a page or in a book they are fine... but i tell ya
some old languages ive used far too long probably look just as confusing
back.

I will breath Classes this weekend,
and most likely have some questions.

Comparers and friends are still not all that clear either.

M.

<tommaso.gasta***@uniroma1.it> wrote in message
Show quoteHide quote
news:1155934885.178189.43900@i3g2000cwc.googlegroups.com...
> Hi Miro. This is not a poetry.
>
> Classes must be your breath.
>
> Arraylist, Hashtable, Sorted List,
> your father, mother and brother.
>
> Comparers your best friends ...
>
> Anyone wants to add more lines ?  :)
>
> Tommaso
>
>
> Miro ha scritto:
>
>> Ive never used classes in the programming languages ive used.
>>
>> So that is my next lesson.
>> I stayed away from the array lists cause I didnt like how all the items
>> have
>> to be the same "var type "
>>
>> I just want to store a whole bunch of data in 1 variable with many
>> different
>> vartypes and change the
>> variable elements as i need to.
>>
>> Someone once pointed me on this newgroup to the object, so now im at the
>> point to use the "object" var
>> i created and im running into this.
>>
>> So a class it will be - as long as i can achieve the above posted.
>> I can always make something like  "dim bla(,) as String" and strigify
>> everything and val it as i need to cause i know
>> which elements are going to be numeric.
>> I just didnt  think it would be this hard to store different variable
>> types
>> / variables all in one array.
>>
>> So im off to read about classes .... my next post might be about them :)
>>
>> Thanks.
>>
>> <tommaso.gasta***@uniroma1.it> wrote in message
>> news:1155928323.990675.126610@m79g2000cwm.googlegroups.com...
>> > Yes Herfried is right. Go for a class anc collections. Forget about
>> > bidimensional arrays of objects. I have never seen them in a meaningul
>> > .net program.
>> >
>> > tommaso
>> >
>> > rmacias ha scritto:
>> >
>> >> You can try using an ArrayList
>> >>
>> >> Dim listOfObjs As ArrayList = New ArrayList
>> >>
>> >> listOfObjs.Add("Last")
>> >> listOfObjs.Add("String")
>> >> listOfObjs.Add("20")
>> >>
>> >> However, I like Herfried's idea better in creating a class for this
>> >> information and then having an array (or a strongly typed collection)
>> >> for
>> >> them.  It really depends on what you are trying to accomplish.
>> >>
>> >> "Miro" wrote:
>> >>
>> >> > VB 2003 and Im still new to vb, so i hope i can explain this as best
>> >> > I
>> >> > can.
>> >> >
>> >> > I have a variable defined as such: ( simple example )
>> >> >
>> >> >         Dim AVariableOfSorts(,) As Object = _
>> >> >             { _
>> >> >                 {"Last", "String", 20}, _
>> >> >                 {"First", "String", 20} _
>> >> >             }
>> >> >
>> >> >
>> >> > I had to define it as an object so I can have different variable
>> >> > types
>> >> > all
>> >> > within the same array.
>> >> > ( unless there is another way to do this )
>> >> >
>> >> > What im getting is an error  "Option Strict On Disallows Late
>> >> > Binding"
>> >> > when
>> >> > I try to do anything with an array element.
>> >> >
>> >> > For example
>> >> > AVariableOfSorts(1, 1) = ""
>> >> >
>> >> > I would like to keep Strict On on
>> >> >
>> >> > What am I missing ? or how do I get around this issue?
>> >> >
>> >> > I beleive I know the difference between binding.  - Simply put:
>> >> > 1.  Dim X as String  is early binding   and  Dim X as Object  ,...
>> >> > X.GetType.ToString  would be late binding and would
>> >> > take longer during running.
>> >> >
>> >> > Im not sure what to search for in Help / or Online to help myself
>> >> > out.
>> >> >
>> >> > Thanks
>> >> >
>> >> > Miro
>> >> >
>> >> >
>> >> >
>> >> >
>> >
>
Author
19 Aug 2006 5:37 AM
Cor Ligthert [MVP]
Miro,

Reading your message is the answer, you should not use a programming
language as VB.Net, C#, C++ or Java.

Just keep it by VB script or JavaScript.

Just my thought reading your message.

Cor

Show quoteHide quote
"Miro" <miron***@golden.net> schreef in bericht
news:Ols$UcwwGHA.5068@TK2MSFTNGP02.phx.gbl...
> Ive never used classes in the programming languages ive used.
>
> So that is my next lesson.
> I stayed away from the array lists cause I didnt like how all the items
> have to be the same "var type "
>
> I just want to store a whole bunch of data in 1 variable with many
> different vartypes and change the
> variable elements as i need to.
>
> Someone once pointed me on this newgroup to the object, so now im at the
> point to use the "object" var
> i created and im running into this.
>
> So a class it will be - as long as i can achieve the above posted.
> I can always make something like  "dim bla(,) as String" and strigify
> everything and val it as i need to cause i know
> which elements are going to be numeric.
> I just didnt  think it would be this hard to store different variable
> types / variables all in one array.
>
> So im off to read about classes .... my next post might be about them :)
>
> Thanks.
>
> <tommaso.gasta***@uniroma1.it> wrote in message
> news:1155928323.990675.126610@m79g2000cwm.googlegroups.com...
>> Yes Herfried is right. Go for a class anc collections. Forget about
>> bidimensional arrays of objects. I have never seen them in a meaningul
>> .net program.
>>
>> tommaso
>>
>> rmacias ha scritto:
>>
>>> You can try using an ArrayList
>>>
>>> Dim listOfObjs As ArrayList = New ArrayList
>>>
>>> listOfObjs.Add("Last")
>>> listOfObjs.Add("String")
>>> listOfObjs.Add("20")
>>>
>>> However, I like Herfried's idea better in creating a class for this
>>> information and then having an array (or a strongly typed collection)
>>> for
>>> them.  It really depends on what you are trying to accomplish.
>>>
>>> "Miro" wrote:
>>>
>>> > VB 2003 and Im still new to vb, so i hope i can explain this as best I
>>> > can.
>>> >
>>> > I have a variable defined as such: ( simple example )
>>> >
>>> >         Dim AVariableOfSorts(,) As Object = _
>>> >             { _
>>> >                 {"Last", "String", 20}, _
>>> >                 {"First", "String", 20} _
>>> >             }
>>> >
>>> >
>>> > I had to define it as an object so I can have different variable types
>>> > all
>>> > within the same array.
>>> > ( unless there is another way to do this )
>>> >
>>> > What im getting is an error  "Option Strict On Disallows Late Binding"
>>> > when
>>> > I try to do anything with an array element.
>>> >
>>> > For example
>>> > AVariableOfSorts(1, 1) = ""
>>> >
>>> > I would like to keep Strict On on
>>> >
>>> > What am I missing ? or how do I get around this issue?
>>> >
>>> > I beleive I know the difference between binding.  - Simply put:
>>> > 1.  Dim X as String  is early binding   and  Dim X as Object  ,...
>>> > X.GetType.ToString  would be late binding and would
>>> > take longer during running.
>>> >
>>> > Im not sure what to search for in Help / or Online to help myself out.
>>> >
>>> > Thanks
>>> >
>>> > Miro
>>> >
>>> >
>>> >
>>> >
>>
>
>
Author
22 Aug 2006 1:22 PM
Miro
I would like to do it all in VB.
Learn it all as one of you would actaully do it in vb.
I knew javascript pretty good back in 99' to about 2002 ... and then i
stopped using it.  So Im not sure how much
it has changed since then.

Im fiddling with classes now and I can create a Class and property so im
close ( or i think im close ).
So Im assuming now that I can create property's when im all done I will have
1 Class with 3 properties that will be an array,
that will technically be each element of the array i was trying to create.

M.

ps...
Oh... Herfried K. Wagner... the
DirectCast(AVariableOfSorts(1, 1), String) = ""  didnt work, it had the same
issue with late binding or something.





Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:ex0KRF1wGHA.4752@TK2MSFTNGP02.phx.gbl...
> Miro,
>
> Reading your message is the answer, you should not use a programming
> language as VB.Net, C#, C++ or Java.
>
> Just keep it by VB script or JavaScript.
>
> Just my thought reading your message.
>
> Cor
>
> "Miro" <miron***@golden.net> schreef in bericht
> news:Ols$UcwwGHA.5068@TK2MSFTNGP02.phx.gbl...
>> Ive never used classes in the programming languages ive used.
>>
>> So that is my next lesson.
>> I stayed away from the array lists cause I didnt like how all the items
>> have to be the same "var type "
>>
>> I just want to store a whole bunch of data in 1 variable with many
>> different vartypes and change the
>> variable elements as i need to.
>>
>> Someone once pointed me on this newgroup to the object, so now im at the
>> point to use the "object" var
>> i created and im running into this.
>>
>> So a class it will be - as long as i can achieve the above posted.
>> I can always make something like  "dim bla(,) as String" and strigify
>> everything and val it as i need to cause i know
>> which elements are going to be numeric.
>> I just didnt  think it would be this hard to store different variable
>> types / variables all in one array.
>>
>> So im off to read about classes .... my next post might be about them :)
>>
>> Thanks.
>>
>> <tommaso.gasta***@uniroma1.it> wrote in message
>> news:1155928323.990675.126610@m79g2000cwm.googlegroups.com...
>>> Yes Herfried is right. Go for a class anc collections. Forget about
>>> bidimensional arrays of objects. I have never seen them in a meaningul
>>> .net program.
>>>
>>> tommaso
>>>
>>> rmacias ha scritto:
>>>
>>>> You can try using an ArrayList
>>>>
>>>> Dim listOfObjs As ArrayList = New ArrayList
>>>>
>>>> listOfObjs.Add("Last")
>>>> listOfObjs.Add("String")
>>>> listOfObjs.Add("20")
>>>>
>>>> However, I like Herfried's idea better in creating a class for this
>>>> information and then having an array (or a strongly typed collection)
>>>> for
>>>> them.  It really depends on what you are trying to accomplish.
>>>>
>>>> "Miro" wrote:
>>>>
>>>> > VB 2003 and Im still new to vb, so i hope i can explain this as best
>>>> > I can.
>>>> >
>>>> > I have a variable defined as such: ( simple example )
>>>> >
>>>> >         Dim AVariableOfSorts(,) As Object = _
>>>> >             { _
>>>> >                 {"Last", "String", 20}, _
>>>> >                 {"First", "String", 20} _
>>>> >             }
>>>> >
>>>> >
>>>> > I had to define it as an object so I can have different variable
>>>> > types all
>>>> > within the same array.
>>>> > ( unless there is another way to do this )
>>>> >
>>>> > What im getting is an error  "Option Strict On Disallows Late
>>>> > Binding" when
>>>> > I try to do anything with an array element.
>>>> >
>>>> > For example
>>>> > AVariableOfSorts(1, 1) = ""
>>>> >
>>>> > I would like to keep Strict On on
>>>> >
>>>> > What am I missing ? or how do I get around this issue?
>>>> >
>>>> > I beleive I know the difference between binding.  - Simply put:
>>>> > 1.  Dim X as String  is early binding   and  Dim X as Object  ,...
>>>> > X.GetType.ToString  would be late binding and would
>>>> > take longer during running.
>>>> >
>>>> > Im not sure what to search for in Help / or Online to help myself
>>>> > out.
>>>> >
>>>> > Thanks
>>>> >
>>>> > Miro
>>>> >
>>>> >
>>>> >
>>>> >
>>>
>>
>>
>
>
Author
22 Aug 2006 2:46 PM
Cor Ligthert [MVP]
Miro,

If you create a class, something as

\\\
Public Class whatever
Private whatevervalue as string
Private whateelsevalue as string
Public property TheFirstValue as string
Get
    return whatevervalue
End Get
Set (by value as string)
    whatevervalue = value
end set
'The same for secondvalue
End Class
///

Than you can do
Dim myArray as list of (whatever)

all typed in this message so watch typos or other errros.

I hope this helps,

cor


Show quoteHide quote
"Miro" <miron***@golden.net> schreef in bericht
news:%23eaFf3exGHA.428@TK2MSFTNGP03.phx.gbl...
>I would like to do it all in VB.
> Learn it all as one of you would actaully do it in vb.
> I knew javascript pretty good back in 99' to about 2002 ... and then i
> stopped using it.  So Im not sure how much
> it has changed since then.
>
> Im fiddling with classes now and I can create a Class and property so im
> close ( or i think im close ).
> So Im assuming now that I can create property's when im all done I will
> have 1 Class with 3 properties that will be an array,
> that will technically be each element of the array i was trying to create.
>
> M.
>
> ps...
> Oh... Herfried K. Wagner... the
> DirectCast(AVariableOfSorts(1, 1), String) = ""  didnt work, it had the
> same issue with late binding or something.
>
>
>
>
>
> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
> news:ex0KRF1wGHA.4752@TK2MSFTNGP02.phx.gbl...
>> Miro,
>>
>> Reading your message is the answer, you should not use a programming
>> language as VB.Net, C#, C++ or Java.
>>
>> Just keep it by VB script or JavaScript.
>>
>> Just my thought reading your message.
>>
>> Cor
>>
>> "Miro" <miron***@golden.net> schreef in bericht
>> news:Ols$UcwwGHA.5068@TK2MSFTNGP02.phx.gbl...
>>> Ive never used classes in the programming languages ive used.
>>>
>>> So that is my next lesson.
>>> I stayed away from the array lists cause I didnt like how all the items
>>> have to be the same "var type "
>>>
>>> I just want to store a whole bunch of data in 1 variable with many
>>> different vartypes and change the
>>> variable elements as i need to.
>>>
>>> Someone once pointed me on this newgroup to the object, so now im at the
>>> point to use the "object" var
>>> i created and im running into this.
>>>
>>> So a class it will be - as long as i can achieve the above posted.
>>> I can always make something like  "dim bla(,) as String" and strigify
>>> everything and val it as i need to cause i know
>>> which elements are going to be numeric.
>>> I just didnt  think it would be this hard to store different variable
>>> types / variables all in one array.
>>>
>>> So im off to read about classes .... my next post might be about them :)
>>>
>>> Thanks.
>>>
>>> <tommaso.gasta***@uniroma1.it> wrote in message
>>> news:1155928323.990675.126610@m79g2000cwm.googlegroups.com...
>>>> Yes Herfried is right. Go for a class anc collections. Forget about
>>>> bidimensional arrays of objects. I have never seen them in a meaningul
>>>> .net program.
>>>>
>>>> tommaso
>>>>
>>>> rmacias ha scritto:
>>>>
>>>>> You can try using an ArrayList
>>>>>
>>>>> Dim listOfObjs As ArrayList = New ArrayList
>>>>>
>>>>> listOfObjs.Add("Last")
>>>>> listOfObjs.Add("String")
>>>>> listOfObjs.Add("20")
>>>>>
>>>>> However, I like Herfried's idea better in creating a class for this
>>>>> information and then having an array (or a strongly typed collection)
>>>>> for
>>>>> them.  It really depends on what you are trying to accomplish.
>>>>>
>>>>> "Miro" wrote:
>>>>>
>>>>> > VB 2003 and Im still new to vb, so i hope i can explain this as best
>>>>> > I can.
>>>>> >
>>>>> > I have a variable defined as such: ( simple example )
>>>>> >
>>>>> >         Dim AVariableOfSorts(,) As Object = _
>>>>> >             { _
>>>>> >                 {"Last", "String", 20}, _
>>>>> >                 {"First", "String", 20} _
>>>>> >             }
>>>>> >
>>>>> >
>>>>> > I had to define it as an object so I can have different variable
>>>>> > types all
>>>>> > within the same array.
>>>>> > ( unless there is another way to do this )
>>>>> >
>>>>> > What im getting is an error  "Option Strict On Disallows Late
>>>>> > Binding" when
>>>>> > I try to do anything with an array element.
>>>>> >
>>>>> > For example
>>>>> > AVariableOfSorts(1, 1) = ""
>>>>> >
>>>>> > I would like to keep Strict On on
>>>>> >
>>>>> > What am I missing ? or how do I get around this issue?
>>>>> >
>>>>> > I beleive I know the difference between binding.  - Simply put:
>>>>> > 1.  Dim X as String  is early binding   and  Dim X as Object  ,...
>>>>> > X.GetType.ToString  would be late binding and would
>>>>> > take longer during running.
>>>>> >
>>>>> > Im not sure what to search for in Help / or Online to help myself
>>>>> > out.
>>>>> >
>>>>> > Thanks
>>>>> >
>>>>> > Miro
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>
>>>
>>>
>>
>>
>
>