Referencing Variables - Accessed None... - Please Explain

Ok, so you can only make this call while team select ref is assigned to something.

Let me put it another way.

If you have an integer variable, you can always use it. If you didn’t spend the time getting it ready, it’s gonna have 0 in it. You have to do stuff with the variable, otherwise you might as well not have it.

If you have a reference to an X thing, you have to say WHICH X thing you mean before you can do stuff to it. YOU know you only have one widget of type X, but the system doesn’t know that, as far as it’s concerned, you could have 14,000. So you have to say WHICH X you’re talking about.

Then, you can process it.

Sometimes, you might need to cast to do this, but very often not. You just have to say which X this reference is pointing at.

You do this, by taking the reference that’s always returned when ever you create anything, and putting it in the variable.

Is it making sense? :slight_smile:

1 Like