1 / 4

Where is my error?

Where is my error?. The IDE will show an error message for syntax errors. In both IDEs there will be some indication of a syntax error found in your code These indications happen ONLY when the code is being executed

Télécharger la présentation

Where is my error?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Where is my error?

  2. The IDE will show an error message for syntax errors • In both IDEs there will be some indication of a syntax error found in your code • These indications happen ONLY when the code is being executed • So if your code has 2 or more branches, do not assume there are no syntax errors just because it ran correctly ONE time. Make sure your tests go through all possible paths to make sure you have no syntax errors.

  3. For IDLE • Some syntax errors are indicated with a little box that says Syntax Error. To find where it thinks the error is, look back at your source code. • There will be a line (or less!) highlighted. That is the location of the error, according to the interpreter. • If you want to know what line number that is on, (since IDLE does not show the line numbers like WingIDE), look at the lower right corner of the source or edit window, you’ll see the row and column the cursor is on.

  4. According to the interpreter? • Sometimes the interpreter is not right in the location of the error! • It IS correct that there is an error, but it may not be on the line that the interpreter indicates. • Where to look then? • Look at the line indicated, and 2-3 lines above (lesser numbered lines) that location. The error could be there, but the interpreter didn’t understand it was an error until it had seen the next line. • There is no point looking after (below) that location (higher numbered lines) . There may be errors down there but they are not the cause of the current error indicator.

More Related