random number selection and display

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #31
    Originally posted by Modibbo
    i want to check the answers with the if...then...els e statement at the end of the program, but i don't know, it its always running the else part...
    Have you interrupted the code and examined the values at that point, to see what doesn't match?

    Comment

    • Modibbo
      New Member
      • Apr 2007
      • 33

      #32
      Originally posted by Killer42
      Have you interrupted the code and examined the values at that point, to see what doesn't match?
      as a matter of fact, i don't know how to interrupt the code and always wondered how to do it

      Comment

      • SammyB
        Recognized Expert Contributor
        • Mar 2007
        • 807

        #33
        Originally posted by Modibbo
        as a matter of fact, i don't know how to interrupt the code and always wondered how to do it
        Before running the code, click on the grey-bar to the left of your code, beside the line of code you are interested in. Then when you run your code, it will "break" (temporally stop, waiting for you) just before it executes that line. You can examine objects and variables by hovering over them, step to the next statement (F10), step into a subroutine(F11) , or resume execution(F5).

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #34
          Originally posted by SammyB
          Before running the code, click on the grey-bar...
          You should learn to use the debugging facilities built into VB - they are essential for debugging, or just making sure you understand, your code.

          They allow you to stop the execution, examine and change values, and step through the execution so that you can watch exactly what is executing. Just seeing precisely which statements are executed can often show up bugs. "Oh, I thought that IF would be FALSE...".

          Comment

          Working...