Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Who here is VERY good at troubleshooting QB programs?
#31
If it's not doing exactly what you want, sounds like you're gonna have to walk through the code to see what it's doing and maybe make adjustments.
*****
Reply
#32
in that case, let me ask a few quations on the coding.

1. Why is "GOTO" used?
2. In "PICKED = I: nx(I) = 1" what is ":"
3. Is "flag" just a variable?
Not yet Snake! It's not over yet!
Reply
#33
Quote:in that case, let me ask a few quations on the coding.

1. Why is "GOTO" used?
2. In "PICKED = I: nx(I) = 1" what is ":"
3. Is "flag" just a variable?
(1) There's only one GOTO used. That's in the the NUMBERS subroutine where it does a GOTO 1. The label 1 is in the subroutine HOME. This is a very bad practice. However, if this logic is working, leave it alone for now.

(2) The ":" between these two statements is the same as having written them on separate lines, like
PICKED = I
nx(I) = 1
Some programmers like to put multiple statements on the same line separating them with colons ":". This was mostly done by older QB programmers before the concept of structured programming came about. It is annoying when reading someone else's code.

(3) "flag" is just a variable like any other. It is not a reserved word.

Good! Sounds like you're trying to understand the code. Keep it up.
*****
Reply
#34
Code:
FOR I=1 TO 10
      INPUT "ENTER THE NUMBERS FOR THIS FIRST ENTRY, EACH FOLLOWED BY A COMMA, EXCEPT FOR THE LAST ONE"; A, B, C, D, E, F, G, H, I, J
      ENTRY(I,1) = A
      ENTRY(I,2) = B
      ENTRY(I,3) = C
      ENTRY(I,4) = D
      ENTRY(I,5) = E
      ENTRY(I,6) = F
      ENTRY(I,7) = G
      ENTRY(I,8) = H
      ENTRY(I,9) = I
      ENTRY(I,10) = J
      DO
         INPUT "DO YOU WANT TO STOP?(Y/N)"; DONE$
         IF (DONE$ = "Y") THEN GOTO 1
      LOOP UNTIL DONE$ = "N"
   NEXT
The error must be in this bit of code somewhere....
Not yet Snake! It's not over yet!
Reply
#35
What's the error you are referring to?

When it says "Do you want to stop (Y/N)" do you normally enter a capital "N"? If you enter a small "n" it will just ignore it and do nothing.
*****
Reply
#36
this is probably closer to something you want.


Code:
For I=1 To 10
  
    Input "ENTER THE NUMBERS FOR THIS FIRST ENTRY, EACH FOLLOWED BY A COMMA, EXCEPT FOR THE LAST ONE"; A, B, C, D, E, F, G, H, I, J
    ENTRY(I,1) = A
    ENTRY(I,2) = B
    ENTRY(I,3) = C
    ENTRY(I,4) = D
    ENTRY(I,5) = E
    ENTRY(I,6) = F
    ENTRY(I,7) = G
    ENTRY(I,8) = H
    ENTRY(I,9) = I
    ENTRY(I,10) = J

    Do
       Input "DO YOU WANT TO STOP?(Y/N)"; DONE$
       If (UCase$(DONE$) = "Y") Then Goto 1
    Loop Until UCase$(DONE$) = "N"




  Next
Reply
#37
Quote:What's the error you are referring to?

When it says "Do you want to stop (Y/N)" do you normally enter a capital "N"? If you enter a small "n" it will just ignore it and do nothing.
*****

The error I'm referring to is that it won't take numbers higher than 10.

I planned on making it dummy proof later on after I got the main part of it working so I'd make "n" and "y" acceptable later on.
Not yet Snake! It's not over yet!
Reply
#38
Quote:.....

The error I'm referring to is that it won't take numbers higher than 10.
Do you mean where you ask for the 10 numbers separated by commas? I just tested that code entering numbers from 11 to 20, then printed them out. It works fine. Must be a problem later.

At what point in the program are you determining "that it won't take numbers higher than 10?"
*****
Reply
#39
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.
Not yet Snake! It's not over yet!
Reply
#40
Quote: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.

That said, you could input a string, then parse that string for your 10 numbers.
stylin:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)