

The two main ways to examine a program for logic errors are by stepping and tracing. Because you assume that the instructions you write are correct, to find and correct a logic error, you must examine these instruction line by line to see whether they’re missing a step or simply solving the wrong problem altogether.īecause logic errors can prove so difficult to find, Liberty BASIC provides special debugging features to help make this task a little easier. Logic errors, however, occur even after you write your instructions perfectly - except for the fact that they’re the wrong instructions. Similarly, you can often find run-time errors by testing your program by using extreme values of data. Syntax errors can prove fairly easy to find because you just need to look for misspellings or places where you may have forgotten to type a character, such as a closing parenthesis. Of all the types of bugs that can infest your program, none is more insidious than a logic error. By testing extreme ranges of values, you can often smoke out run-time errors before you release your program for actual use. Finally, type a negative number such as –9,489. If your program asks the user to input an age, for example, type a huge number (such as 60,000).

Participating in an Open-Source Project.Put the condition most likely to be true first.

Put the condition most likely to be false first.Making Data Structures with Linked Lists.Putting structured programming into practice.Adding new stuff to an existing text file.Defining the size and location of a window.Looking for a string inside another string.Trimming the front and back of a string.You can start using Liberty BASIC today.P-code: A combination compiler and interpreter.What Do I Need to Know to Program a Computer?.Part III: Advanced Programming with Liberty BASIC.Part II: Learning Programming with Liberty BASIC.
