locked
Problem with VB source code/original RRS feed

  • Question

  • I was baffled by some code that didn't work when it looked correct.

    I inserted a breakpoint, and it was never reached.

    I noticed the breakpoint icon change into a "yellow ring" with a message that my breakpoint can never be reached because my "source code is different from the original version."

    This seems to be caused by an attempt to change code whilst debugging. I never do this.

    I searched for help and found that this problem can be corrected in the full version of VS - but I have Express and the options mentioned are not available.

    I also read that by deleting files from Bin and Obj, the problem could be fixed. Didn't work either.

    Luckily, I had a copy of the project from a few hours earlier. This version works okay. So I have been adding the stuff that I lost when the other version went toes up.

    Guess what? It's just started doing it with the new version too.

    Can anyone suggest anything please as I am thousands of lines into a project and feeling very worried ...

    Rich

    Thursday, October 19, 2006 7:47 PM

Answers

  • Were I in your shoes, I suppose I would temporarily comment out the line (or lines) specifically checking against the "current" date and type in the equivalent code just below it which checks against a dummy date variable that has your desired "current" date in it.  Run to see if it does what you want, changing the dummy date for different test situations, until you are satisfied with the result.  Then delete the "test" lines and uncomment the "real" code.  I know, it's not an ideal test, but your code shouldn't know the difference if you do it right, I would think...  Best of luck.
    Thursday, October 19, 2006 8:50 PM

All replies

  • Okay, unless there's some kind of intermittent problem then I know why this happened.

    Part of the project deals with special circumstances surrounding a leap year day. In order to test this, I had changed the system date. Presumably, the files are date coded and as the current date (attached to the file I am working on) was different to a date stored when the form was created.

    Anyway, my new problem is, how to test the code without waiting until next February!!! 

    Rich

    Thursday, October 19, 2006 8:06 PM
  • Were I in your shoes, I suppose I would temporarily comment out the line (or lines) specifically checking against the "current" date and type in the equivalent code just below it which checks against a dummy date variable that has your desired "current" date in it.  Run to see if it does what you want, changing the dummy date for different test situations, until you are satisfied with the result.  Then delete the "test" lines and uncomment the "real" code.  I know, it's not an ideal test, but your code shouldn't know the difference if you do it right, I would think...  Best of luck.
    Thursday, October 19, 2006 8:50 PM
  • Yeah, just done it that way and all seems well.

    Thanks,

    Rich

    Thursday, October 19, 2006 9:10 PM
  • You're most welcome.
    Thursday, October 19, 2006 9:58 PM