English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have 3 classes,
class one - "card". this class contains properties
class two - "cardcollection". this class inherits list of the type card
class three-"flash". this class inherits list of the type card

This code works.

For i As Integer = 0 To _cardcollec.Count - 1
Dim _card As Card
_card = _cardcollec.Item(i)
_cardcollec.Add(_card)
Next

with this code, i get this error?
Object reference not set to an instance of an object.

For i As Integer = 0 To _cardcollec.Count - 1
Dim _card As Card
_card = _cardcollec.Item(i)
_flash.Add(_card)
Next

I dont understand
thanks
mike

2007-01-24 18:00:26 · 4 answers · asked by Anonymous in Computers & Internet Programming & Design

here is where it crashes

_flash.Add(_card)

If i hover over _card, it contains the correct information.

2007-01-24 18:02:25 · update #1

4 answers

Can't determine without seeing the code for Card and Flash, since Flash inherits from Card and the logic error could be in either.

2007-01-24 18:14:11 · answer #1 · answered by Rex M 6 · 0 0

the object _flash is not set to an instance of an object.
Before adding items to _flash you should instantiate it i.e. create a new instance of it

Dim _flash as New flash

Note: It does not make sense that CardCollection inherits Card. if it is a collection of Cards, it should inherit System.Collections.CollectionBase instead

Thank You.

2007-01-24 20:49:02 · answer #2 · answered by Smutty 3 · 0 0

reducing taxes will basically create jobs if the tax ruin is conditional given basically to those firms which truthfully create jobs. Giving a tax decrease and easily trusting that the recipient will "do the main suitable component" is only funnelling our tax money into fat cats' Bahama's financial agency bills. IMO, company taxation is already too low around the board, apart from very small companies. they could be progressively raised, with the quantity of improve per how lots of a company's is finished via American workers vs performed distant places. while a job is going distant places, no longer basically is an American made jobless, that American is switched over from a contributor to our common prosperity to a drain on our treasury. that's, our treasury LOSES the earnings tax, revenues tax, medicare tax and all the different contributions this worker made to our treasuries. greater desirable, there's a domino effect. If the widget production facility strikes distant places, then the diners and gas stations, the uniform agency, and fairly some different people who depended on the widget makers' as purchasers -- they too are paying much less taxes into our treasuries. IMO making up this shortfall may be the criminal accountability of that agency which chosen to go those jobs distant places. distant places outsourcing would be much less appealing while companies are required to soak up the fee of the harm this does our u . s . a .. people seem to forget that doing agency as a company isn't a outstanding it extremely is a privilige. That privilige is via We the folk contained in this variety of a company shape. A difficulty of that privilige is that the agency no longer act in techniques counter to the pursuits of usa or the yank people -- case in point, no longer sell weapons to our enemies. looks to me that firms have been violating this difficulty with impunity. We the folk could revoke some company charters to remind those fat cats that usa belongs We the folk, and to no longer them.

2016-12-16 12:59:13 · answer #3 · answered by ? 4 · 0 0

I would say you have not instantiated _flash e.g Not defined it so it is accessable in this scope.

I assume you have somewhere (globally ?)
Dim _cardcollec As Cardcollection
You have
Dim _card As Card in this routine.
Where is
Dim _flash As Flash ?

2007-01-24 18:59:56 · answer #4 · answered by Anonymous · 0 0

fedest.com, questions and answers