Last month a program to help design a high pass active filter was printed. The ending of that program was as shown below.
200 PRINT "PRESS 1 TO CONTINUE"
210 IF INKEY$ = "" THEN GOTO 210
220 LET A$ = INKEY$
230 IF A$ = "1" THEN CLS
240 GOTO 10
250 IF A$ = "" THEN STOP
The general idea is that if you enter “1” you will go to the start of the program and be able to modify some of your parameters and recalculate the high pass filter. If you type something else you will stop. But that is not what the program says or does.
Let us look in detail at exactly what the program does say. In line 200 it says press 1 to continue. It gives you no other choice, thus you cannot complain if it does something else or even nothing else.
Consider line 210. That line has been discussed before in this series of articles. It is well written. As long as you do nothing, it does nothing (except repeat itself).
But, as soon as you put something in the keyboard, the IF part of line 210 becomes false, and the program goes to line 220 instead of back to 210. Line 220 just puts whatever you typed on the keyboard, whether a 1 or something else, into the string variable A$.
Line 230 acts as a switch. If A$ is one, the program goes to the last part of line 230 and clears the screen. The program then goes to line 240 which in turn causes line 10 to be executed. But look what happens if anything other than a 1 was in A$. The IF part of 230 is now false and the program goes directly to 240 (hence to 10) just the same. Only now the screen is not cleared and is something of a mess. The program never gets to line 250. It just does not stop (until you pull the plug).
The cure for this problem is fairly simple. First add a line to give the user a clear choice at line 200. Then change line 230 so the program acts on that choice. Try the following lines.
200 PRINT "PRESS 1 TO CONTINUE"
205 PRINT " ANYTHING ELSE TO STOP"
210 IF INKEY$ = "" THEN GOTO 210
220 LET A$ = INKEY$
230 IF NOT A$ = "1" THEN STOP
240 GOTO 10
There you have it, a happy ending for the high pass filter program. The same ending can be used for the lowpass program in this issue and for the next program in this series.
The circuit diagram that should have been placed at the end of the High Pass Filter article last month did not make that issue. It appears at the end of this article.

A circuit diagram for a high pass active filter. The specific values for the three capacitors and the two resistors can be calculated using the program “High Pass Filter” which appeared in the December (1990) issue of QZX.