5.1 What is a logic error?

A logic error is specifying the incorrect logic in a program. This may be the result of misinterpreting instructions or typo mistakes. Let us take a look at the following logic:

myRS.MoveFirst  
Do While not (myRS.EOF)  
  myRS.Edit  
  myRS![Some Column] = SomeValue  
  myRS.Update  
Loop  
    

This loop lacks myRS.MoveNext. As a result, this loop never exits. The symptom of this “bug” is that the program hangs up and does not respond any more.

Other logic errors may simply compute incorrect values, or execute the wrong part of a subroutine. Generally, there is no easy way to describe the symptom of a logic error other than “not doing what the program is supposed to.”