Basic Debug question

Discussion in 'AutoCAD' started by Danno, Apr 4, 2005.

  1. Danno

    Danno Guest

    I created a project added a .lsp file to the project. Now I want to execute the code and debug. I've set break points in the file, but the problem is running the code and watching it. How do I get the debugger to execute the code??
    Thanks
    Daniel
     
    Danno, Apr 4, 2005
    #1
  2. Danno

    Big 'D' Guest

    There are three buttons you can use to step through your code. These are the three left-most icons on the Debug toolbar. In sequence, they represent the following actions:

    Step in to the highlighted expression.
    Step over to the end of the highlighted expression.
    Step out to the end of the function where you are currently stopped.
    Before you make a selection, take another look at the status of the highlighted code, the cursor position, and the Step Indicator button. In summary: An expression is highlighted, consisting of a getdist function nested within a setq function, and the cursor is positioned at the very beginning of the highlighted block.

    To step through the code from the breakpoint

    Press the Step Over button.
    After you press the Step Over button, control passes to AutoCAD and you are prompted to specify the width of the path.

    Reply to the prompt.
    After you specify the width, control passes back to VLISP. Notice where your cursor is and what the step indicator button shows.

    VLISP evaluates the entire highlighted expression, then stops at the end of the expression.

    Press the Step Over button again. VLISP jumps to the beginning of the next block of code, and highlights the entire block.
    Press the Step Into (not Step Over) button.
    Note: During this exercise, if you make an incorrect selection and skip a step or two, you can restart the exercise very easily. First, press the Reset button from the Debug toolbar. This terminates the execution of any VLISP code, and resets the VLISP system to the top level. Next, start over at step 1.

    Now the first cons function is highlighted, and VLISP is stopped right before the function (notice the Step Indicator button).

    Good Luck,
    D
     
    Big 'D', Apr 4, 2005
    #2
  3. Danno

    Big 'D' Guest

    By the way...where did the nickname Danno come from?
     
    Big 'D', Apr 4, 2005
    #3
  4. Danno

    Danno Guest

    oh you know the ol deal.... Danno, Dantana, Dan the Man, Big D.. lol.. I think Danno comes from some place. Not sure. But I got the debugger to work.. the problem was the first line of code caused the program to exit.. I couldn't figure it out.. But when I read what you wrote, I knew I was debugging properly, then I solved the problem.. lol
    Thanks!
     
    Danno, Apr 4, 2005
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.