|
|
#1 |
|
New Member
Join Date: Aug 04
Posts: 9
![]() |
Problem with a bingo game!!! Help
i cant think of more code to write for such a simple game. When i started writing this program i didnt know so much about control arrays so i had to make a whole lotta code for minimum functions.
the problem is when i try to make the numbers in a same line diffrent i get an overflow and and error. Plus, there are 2 cartons and whenever theres the same number in both of em, it only marks it in the first... Any help is good.... heres the whole folder |
|
|
|
|
|
#2 |
|
Hyperactive Member
Join Date: Apr 02
Location: UK
Posts: 506
![]() |
I just had to change the code in your Command4_Click event:
VB Code:
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Aug 04
Posts: 9
![]() |
thanks a bunch...can you tell me exactly what u did'?
|
|
|
|
|
|
#4 |
|
Hyperactive Member
Join Date: Apr 02
Location: UK
Posts: 506
![]() |
Well you had the code to change each of the label background colours in a long chain of elseif statements, thus if one label was found to have the correct number the "if loop" would end and no other labels would be checked.
Try to imagine the workings of if statements as below, if one condition of the "elseif chain" is met then no others are compared: Code:
IF label1.caption = "one" THEN ..do something goto DONEIF ELSEIF label1.caption = "two" THEN ..do something goto DONEIF ELSEIF label2.caption = "one" THEN ..do something goto DONEIF ELSEIF label2.caption = "two" THEN ..do something goto DONEIF END IF DONEIF: the above was implemented in VB or any other programming language, the caption of label2 would never be checked if the caption of label 1 was one or two.With my code the for loop checks every label in the control array and if it has the correct number then the background colour is changed. |
|
|
|
|
|
#5 |
|
VB6, XHTML & CSS hobbyist
Join Date: Oct 02
Location: Finland
Posts: 5,948
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Why you have Goto DONEIF there? The code would jump there even if there wouldn't be any gotos.
__________________
VB6 in occasional use. I'm all HTML, CSS & JavaScript these days.
« Antec Sonata II: Core 2 Duo E7400, ASRock P45TS, Asus EN9600GT 512 MB, 4 GB, 1.25 TB » « OS: Windows 7 | Laptop: Amilo Pi 2530-12P| Netbook: Asus EEE 901 » |
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|