Who here is VERY good at troubleshooting QB programs? - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: QBasic (http://qbasicnews.com/newforum/forum-4.html) +--- Forum: QB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-11.html) +--- Thread: Who here is VERY good at troubleshooting QB programs? (/thread-8188.html) |
Who here is VERY good at troubleshooting QB programs? - Moneo - 10-14-2005 Quote:Well, for one, line 65 and another is line 92. I don't know how to go about fixing it. However I think that's what the error means.I've been testing Antoni's version. I don't know why you get a subscript out of range on line 65. It works ok for me. I think you should print a message saying that the numbers entered should have a maiximum value of 52, even though you are not checking this. The error on line 92 is because he used "X1" to store a value, but X1 is already used in the FOR statement right above. The corrected code using X2 should look like this: Code: FOR X1=1 TO 10 Another possible problem is that at the end of showing the probabilites, it prints the first set as all zeros. Your original version is huge and has lots of little problems all over the place. I suggest you work on Antoni's version. It's much simpler and compact, and with a little work it should be ok for you. Please tell us which version you want to work on, so we can continue to try to help you. ***** Who here is VERY good at troubleshooting QB programs? - Liquid Snake - 10-14-2005 I don't care as long as it works. Who here is VERY good at troubleshooting QB programs? - Moneo - 10-14-2005 Quote:I don't care as long as it works. You're not buying it, you're making it and asking for help. Decide on the version, yours or Antoni's. I'm not gonna spend any more time debugging the version that you may not decide to use. ***** Who here is VERY good at troubleshooting QB programs? - Liquid Snake - 10-14-2005 Alright, sorry... Lets go with Antoni's program. I just get frustrated with these programs sometimes....... Who here is VERY good at troubleshooting QB programs? - Moneo - 10-15-2005 Ok, great. Apply the change that I posted above, and do some testing. You know what numbers to put in and what the output should be. When you get stuck, let us know. Where's Antoni when we need him? ***** Who here is VERY good at troubleshooting QB programs? - Liquid Snake - 10-30-2005 I find that the only numbers that will work without getting a subscript out of range error are numbers 1-10. Anything higher and I get the erorr on line 65. Who here is VERY good at troubleshooting QB programs? - Moneo - 10-31-2005 Maybe this is the reason: PRINT "YOU CAN ENTER UP TO 10 SETS OF NUMBERS." PRINT "YOU CAN ENTER A MAXIMUM OF 10 NUMBERS PER SET. ***** Who here is VERY good at troubleshooting QB programs? - Liquid Snake - 10-31-2005 I haven't found any limitations in the coding for the number you enter though. Who here is VERY good at troubleshooting QB programs? - Liquid Snake - 10-31-2005 oh wait I see why. The "i" part of the for loop interferes with the "i" value you enter into the program. Who here is VERY good at troubleshooting QB programs? - Liquid Snake - 10-31-2005 I fixed that part, but I'm only getting one number ten times for the probability. Code: REM Lottery Probability |