! Test program for receiving and transmitting via COM port
! Set the communication parameters on the Windows Control Panel beforehand.
! To send a end-of-line, type Ctrl-Enter.
SET ECHO "OFF"         
OPEN #1 :NAME "COM1"          ! "COM1" should be altered for the acual port
DO
   ASK #1: CHARACTER PENDING N   ! Assigns the number of characters that lies in the receiving buffer.
   IF N>0 THEN               
      CHARACTER INPUT #1: S$       
      PRINT S$;
   END IF
   ASK CHARACTER PENDING N       ! Assigns the number of characters that lies in key input buffer.       
   IF N>0 THEN
      CHARACTER INPUT S$
      PRINT #1:S$;
   END IF
   WAIT DELAY 0.01
LOOP 
CLOSE #1  
END

