home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / BASIC / POWBASIC / LIBRARY1 / EXAMP1.ZIP / RMEX198.BAS < prev    next >
BASIC Source File  |  1990-03-28  |  500b  |  19 lines

  1. 'Reference Manual Example Page 198
  2. CLS
  3.  
  4. $COM 1024                       'set up 1K input buffer
  5. OPEN "COM1:300,n,8,1,DS,RS,CS,CD" AS #1 LEN = 1
  6. PRINT "Press any key to terminate the program..."
  7. 'while a key hasn't been pressed
  8. WHILE NOT INSTAT
  9.   'if there is any input available
  10.   IF LOC(1) <> 0 THEN
  11.     'read any info available in the COM port buffer
  12.     COMPortInput$ = INPUT$(LOC(1), #1)
  13.     'display input
  14.     PRINT "COM Port input: "; COMPortInput$
  15.   END IF
  16. WEND
  17. CLOSE 1
  18. END
  19.