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-31-2005 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. ***** Who here is VERY good at troubleshooting QB programs? - Liquid Snake - 10-31-2005 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? Who here is VERY good at troubleshooting QB programs? - Moneo - 11-01-2005 Quote:in that case, let me ask a few quations on the coding.(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. ***** Who here is VERY good at troubleshooting QB programs? - Liquid Snake - 11-01-2005 Code: FOR I=1 TO 10 Who here is VERY good at troubleshooting QB programs? - Moneo - 11-02-2005 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. ***** Who here is VERY good at troubleshooting QB programs? - Anonymous - 11-02-2005 this is probably closer to something you want. Code: For I=1 To 10 Who here is VERY good at troubleshooting QB programs? - Liquid Snake - 11-02-2005 Quote:What's the error you are referring to? 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. Who here is VERY good at troubleshooting QB programs? - Moneo - 11-03-2005 Quote:.....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?" ***** Who here is VERY good at troubleshooting QB programs? - Liquid Snake - 11-04-2005 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. Who here is VERY good at troubleshooting QB programs? - stylin - 11-04-2005 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. |