Quote:Liquid Snake Wrote:alright, well for me it won't allow me to input any number greater than 10 at the point where you enter the 10 numbers. I don't know why it works for you. Maybe it's the version of QB....I don't know.
I can't help but think it's got something to do with your index variable, I, conflicting with the I in your input statement. Change your index variable to Z, or better, index......
Thanks stylin, that's got to be it! Yeah, change the index variable, or easier yet, change the "I" in the input list to something else and the reference to it also.
I just noticed that the version that I downloaded for testing has A,B,C,D,E,F,G,H,S,T. That's why it worked. You must have changed it to ....H,I,J later and inadvertently clobbered the "I" index.
Great! We're moving right along.
*****
OK, I changed it but have the same result. Do you think it could be because of this line towards the top?
Quote:OK, I changed it but have the same result. Do you think it could be because of this line towards the top?
No, all that does is set the default for all variable to INTEGER instead of SINGLE. This should not have any effect on the code as I see it.
Post the code that you just corrected. Better still, post the latest version of the entire program again.
*****
Quote:OK, I changed it but have the same result .....
Using your latest posted version, I ran a test entering numbers from 11 to 20.
At the end of the numbers subroutine I added some code to print out the 10 numbers input.
It prints the numbers 11 to 20 fine, so it is inputting them correctly.
Tell me what kind of error you're getting.
BTW, while looking at the PROB: subroutine, I noticed the following potential problems:
1) If the user enters a number greater than 52,
then the instruction X(X2)=X(X2)+1 will hang up because X is an array DIMed as (1 to 52). You need to check the number. You'll probably need to re-write the input logic.
2) In your instructions to the user you say to place zeros in the extra spaces. This also will hang on the same instruction because zero is not within 1 to 52. You need to put an "if" here to skip the zero values.
*****
In my original program the zero thing would have worked. You need to be able to put something into the spaces that aren't used, that's why I came up with the zero idea since the lottery numbers range from 1-52. But, yeah I'll put an IF in there once this programs works.
I don't know why I get the error, but I do. I just tried it again.
Quote:.....
I don't know why I get the error, but I do. I just tried it again.
I'm not sure anymore what "the error" is that you're getting. Tell me exactly what numbers you input and how you are determining "the error" and what it is.
*****
Sorry, I must have screwed up somehow, I'm now getting the input in correctly too. The problem, if you test it out, is that after you put in the numbers and you select "find probabilities" it only gives you 1 number. It should give you 10 different numbers.
Ok, I took a look at the following from the PROB subroutine:
Code:
FOR X1 = 1 TO 10
FOR X = 1 TO 10
X2 = ENTRY(1, X)
X(X2) = X(X2) + 1
NEXT X
NEXT X1
It loops on the value X1, but it never uses it. I don't understand what it's doing but maybe the line X2=ENTRY(1,X)
should be X2=ENTRY(X1,X).
What do you think?
*****
Well, I tried it but all I get is a "subscript out of range error" I also noticed that the number that it shows for the probability is always the same.....10. One of the for loops must be messing the variables up.