66
FUNCTION TKDATA
LINE INPUT #1, RD$ 'Read COM1.
TKDATA = VAL(RD$) 'Convert a string to numeric value and return
'the value to main program.
END FUNCTION
SUB TKECHO
LINE INPUT #1, PROMPT$ 'Get a string from COM1. Check if
'PROMPT$=<LF>+"=>"
PROMPT$ = RIGHT$(PROMPT$, 2) 'Discard <LF>
IF PROMPT$ <> "=>" AND PROMPT$ <> "*>" THEN 'If not successful then ...
LOCATE 24, 1 'Set the printing position to Line 24, column 1
PRINT "COMMAND EXECUTE ERROR !" 'Print error message.
END IF
END SUB