Re: How to create array class?
- From: Daniel <Daniel@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 7 Jan 2007 17:47:00 -0800
Hi all,
thanks for the help.
Finally, _AnonCoward has identified the root cause which i almost forget
:shared syntax.
Thanks for all the help given.
Rgrds,
GL
"_AnonCoward" wrote:
.
"Daniel" <Daniel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DB4E9F2F-9C1A-49E6-9088-E5F900F7FB83@xxxxxxxxxxxxxxxx
: Hi all,
:
: thanks for your response.
: I managed to solve the "object reference to null..." error
: message,however, another issue appears.
:
: I cannot get the list of 5 different records to be updated into the
: class arrays, for instance:
:
: inputs:
: eply(0).name="Krish"
: eply(1).name="James"
: eply(2).name="Bond"
:
: outputs:
: all display as "Bond" name which is the last record during updating.
:
: In my class, my code as follow:
: public shared sname as string
:
: Public Shared Property name() As String
: Get
: Return sname
: End Get
: Set(ByVal Value As String)
: sname = Value
: End Set
: End Property
:
: Any advice, please.
:
: thank you in advance.
Sorry for the earlier response. I fat fingered and inadvetantly sent
the post. Oops...
Anyway, your name variable (sName) is Shared which means there is only
one copy of it. When each object's name property is being set, they
are all setting the value of the same variable. Try removing the
Shared keyword.
Ralf
--
--
----------------------------------------------------------
* ^~^ ^~^ *
* _ {~ ~} {~ ~} _ *
* /_``>*< >*<''_\ *
* (\--_)++) (++(_--/) *
----------------------------------------------------------
There are no advanced students in Aikido - there are only
competent beginners. There are no advanced techniques -
only the correct application of basic principles.
- Follow-Ups:
- Re: How to create array class?
- From: Cor Ligthert [MVP]
- Re: How to create array class?
- References:
- Re: How to create array class?
- From: Cor Ligthert [MVP]
- Re: How to create array class?
- From: _AnonCoward
- Re: How to create array class?
- Prev by Date: Re: best design for parse
- Next by Date: Re: best design for parse
- Previous by thread: Re: How to create array class?
- Next by thread: Re: How to create array class?
- Index(es):
Relevant Pages
|
Loading