Click to See Complete Forum and Search --> : Class not working


Waseem Sadiq
January 10th, 2000, 01:24 PM
Hi, it's me again.
I've created a bot class wich contains three other classes called Skill1, Skill4 and Skill5. I declare a variable like Dim myBot as cBot
set anarki = new cBot

. When I try to acces a property of myBot like myBot.skill1.botname = "somename"

then VB gives me the error "Object variable or With block variable not set". Can anybody please help me, I can't possibly figure ou what is wrong. If you want to have a look at the sourcecode (wich was too long to post here) you can try this download link http://botfactory.tripod.com/botfactoy.zip it's size is 558 KB. Thanks a lot

Chris Eastwood
January 11th, 2000, 02:30 AM
I see from your code :

>Dim myBot as cBot
>set anarki = new cBot

> When I try to acces a property of myBot like

>myBot.skill1.botname = "somename"

That you haven't actually assigned 'myBot' to anything.

Shouldn't it be :


Dim myBot as cBot
set myBot = new cBot
'
myBot.Skill1.BotName = "SomeName"




- If this isn't the problem, make sure that your 'cSkill' classes are being created in the cBot Class_Initialise routine.

I tried to download your code, but Tripod just says that the file can't be found.



Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb

Waseem Sadiq
January 11th, 2000, 10:32 AM
Sorry, I made two mistakes. I mistyped the second name, it should have been Anarki. I'm aware of that fact. Second, the correct URL for the zipfile is <URL>http://botfactory.tripod.com/botfactory.zip[/URL]