Hyperon
asked on
ERROR : object or with block variable not defined
i have a class, agrid
in it i have (among other things): public special as integer
i call a member of an array defined as follows : public Grid(0 to 3)
The line it spits out :
Grid(3).special = val(tempstr)
in it i have (among other things): public special as integer
i call a member of an array defined as follows : public Grid(0 to 3)
The line it spits out :
Grid(3).special = val(tempstr)
ASKER
I tried to use set Grid(0 to 3) = new aGrid
but that didnt work, ill try your idea
but that didnt work, ill try your idea
ASKER
Sorry, Didnt work
ASKER
sorry, the error is : object variable or with block variable not set
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sorry, no results
ASKER
that isn't the actual part the error is coming up in though. It refuses to believe that we have set it as an integer or string.
can you paste your code?
ASKER
that last thign worked for one part though. However I have the same error in a different place now, oh well ill fiddle around some more trying to fix it.
ASKER
The new Line that doesn't work now is:-
If Len(tmparray(0)) > 0 Then Grid(tempint).N.Sq = tmparray(0)
it should work but I can't see just why it doesn't.
If Len(tmparray(0)) > 0 Then Grid(tempint).N.Sq = tmparray(0)
it should work but I can't see just why it doesn't.
firstly what does tmparray contain
what is N in the Grid object
and what is Sq in the N object thats in the Grid object?
what is N in the Grid object
and what is Sq in the N object thats in the Grid object?
ASKER
the tmparray contains the info.
N stands for North(for a game)
Sq stands for Square.
sorry, I forgot to explain that lol. (it has nothing to do with a problem with what is in them.)
N stands for North(for a game)
Sq stands for Square.
sorry, I forgot to explain that lol. (it has nothing to do with a problem with what is in them.)
ASKER
Thanxs for all your help I sorted out the problem now and its all fixed and done, thanxs to everyone that helped.
ASKER
do you have to
set acollection = new collection
?????
set acollection = new collection
?????
That depends if you declared 'acollection' like this
dim acollection as new collection
or this
dim acollection as collection
The universally accepted best method is the following
dim acollection as collection
set acollection = new collection
dim acollection as new collection
or this
dim acollection as collection
The universally accepted best method is the following
dim acollection as collection
set acollection = new collection
ASKER
thanks
ASKER
does it work the same for public acollection as collection?
For i = 0 To 3
Set Grid(i) = new grid
Next
Bow you can work with Grid array members.