|
-
Apr 2nd, 2007, 04:43 PM
#1
Thread Starter
New Member
Chess game- Referancing variables in place of objects
Hey, I'm making a Chess game using VB6 using standerd modules. So that I can use standerd modules I've set a variable called posstr1 to contain whatever the name of the space you've just cliked on is (e.g. posstr1 = "cmbA5").
Then later on in the code I'm trying to use that in my standerd modules:
If posstr1.Caption = "WP" Then movewhitepawn
So I'm expecting the computer to think posstr1= "cmbA7" (for example) and go
If cmbA7.Caption = "WP" Then movewhitepawn
(fyi movewhitepawn is another standerd module).
However, VB doesn't like this, I get 'Compile error:Invalid qualifier' and this bit highlighted. Is there actually a way to do this (referance a variable in place of an object?
Fyi, nearly everything involving variables is in public subs for now, though a way to just pass the variables and keep everything in private subs would be helpful as well.
Thanks to anyone that helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|