1 REM v0.1
2 " "CLEAR :WAIT 90:LOCK :USING 
3 PRINT "      PH CALCULATIONS":PRINT "  Copr. 1982 Tandy Corp.":ON ERROR GOTO 400
10 CLS :WAIT 0:PRINT "Enter:    H+  OH- PH  end":WAIT 
20 I=ASC INKEY$ -18:ON IGOTO 100,200,300,500
30 GOTO 20
100 H=-1:INPUT "H+ concentration? ";H
110 IF H>=1OR H<1E-14THEN 100
120 O=1E-14/H:PRINT USING "###.##^";"OH- conc. =";O
130 P=-LOG H:PRINT USING "###.##";"PH =";P
150 P$="":WAIT 0:PRINT CHR$ 34;"P";CHR$ 34;:INPUT " to print, ENTER ";P$:CLS 
160 IF P$<>"P"THEN 10
170 TEXT :CSIZE 2:LPRINT "PH  =";USING "###.##";P:LPRINT "H+  =";USING "###.##^";H:LPRINT "OH- =";O:LF 3:GOTO 10
200 O=-1:INPUT "OH- concentration? ";O
210 IF O>=1OR O<1E-14THEN 200
220 H=1E-14/O:PRINT USING "###.##^";"H+ conc. =";H
230 P=-LOG H:PRINT USING "###.##";"PH =";P:GOTO 150
300 P=0:INPUT "PH value? ";P
310 IF P<=0OR P>=14THEN 300
320 H=10^-P:PRINT USING "###.##^";"H+ conc. =";H
330 O=1E-14/H:PRINT "OH- conc. =";O:GOTO 150
400 USING :PRINT "*** ERROR";PEEK &789B;" in";STATUS 4;" ***":GOTO 10
500 UNLOCK :END
