Requesting Help With Simple Bowling Scorekeeper Program
Hello vbFolks. I'm quite new at designing programs with visual basic so I'd like to enlist for some advice.
First of all, I'm a computer science student that ventured down the C++ path for a little too long and I re-specced to a VB-oriented track. Since then I've had 1 very basic class in VB programming. I've been working on a little side program for keeping bowling scores but I'm at an impasse and would like some help.
Am I able to do this by using a simple set of control arrays (say 2 text boxes and 1 label per "frame") and using them inside some kind of repetition statement?
on the form i have control arrays txtFirst(10) and txtSecond(10) for balls thrown
and lblScore(10) for the score on each frame. The user types the score for each
ball and I want it to update the Score label automatically.
I cannot figure out how to store the typed numbers to the txtFirst(i).text property at runtime. What's more is that I've had equally frustrating moments trying to do something as simple as Code: lblScore(i).Caption = Val(txtFirst(i).text) + Val(txtSecond(i).text) for the first frame on the sheet, then trying to carry forward that value for future use.
I'd appreciate some insight on the basics. TIA for the help.
Edited by - okipatrick on 6/9/2003 9:15:41 PM
hi guys, i'm pretty new at this and i need a bit of help
i'm making a jeopardy game. the form has 5 labels on top for categories
and 5 command buttons (100-500) for each category.
when the program starts a series of input boxes come up asking for you
to create your categories, questions and answers. these are functions
1) function makecategory()
a = InputBox("What do you want the first category to be?", "First Category", "type what you want the first category to be here")
Label2.Caption = a
b = InputBox("What do you want the second category to be?", "Second Category", "type the second category in here")
Label3.Caption = b
2) questions and answers for the first category
fstques100 = InputBox("What do you want the 100 point question for " + (a) + " to be?", (a) + " For 100")
fstans100 = InputBox("What is the answer to the 100 point question you just entered?", "100 Point Answer")
fstques200 = InputBox("What do you want the 200 point question for " + (a) + " to be?", (a) + " For 200")
fstans200 = InputBox("What is the answer to the 200 point question you just entered?", "200 Point Answer")
fstques300 = InputBox("What do you want the 300 point question for " + (a) + " to be?", (a) + " For 300")
3) this is just to have a label at the bottom keep score
Label7.Caption = points
4)Private Sub formload()
as you can see, just a lot of repeating
each command button for the question is coded like this
Private Sub CommandButton1_Click()
ques1100 = InputBox((fstques100), (a) + " For 100")
If LCase(ques1100) = LCase(fstans100) Then
hfgk = MsgBox("Correct!", vbOKOnly, "Jeopardy")
points = points + 100
CommandButton1.Visible = False
gjhdfg = MsgBox("Incorrect, The Correct Answer is " + (fstans100), vbOKOnly + vbCritical, "Jeopardy")
points = points - 100
CommandButton1.Visible = False
I realized that if you make a set of questions you should be able to save them, and re use them instead of typing in all of them input boxes again
I added another form which has a combo box, and 3 command buttons (exit, ok (to pick a saved set),cancel and create your own., i'm not familiar with working with multiple forms so i need help on getting the question set form to come up first when the program runs. i also need help coding the combo box to open up question sets, how to save sets when you make them, as the game starts, and if you load a set, how to make the program not ask you for the questinos and categories again. Thanks for any help.
if you can please send a copy of your response to
that would also be of great help
Edit by Iceplug: Purpose of forum is to exchange advice at the forum
Jeopardy Game Continued
For those of you who helped me before I thank you.
heres the link to the old thread for the new people or if you need to refresh your memory:http://www.xtremevbtalk.com/showthread.php?t=261656
the code works great but i'm having trouble with the answers and the category names. Is it possible to connect the name and answer together in the code or does it have to be done outside?
And which would work better: make the player to click on the answer amount and get a separate window or still have the aswer in the same window but just at the bottom?
The program at this point is attached to help if its needed (the reason i haven't gotten much farther than this is because my drive with all of my older projects crashed and i can't get any of the data back, its a real bummer.)