home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / BASIC / POWBASIC / LIBRARY1 / EXAMP1.ZIP / UMEX258.BAS < prev    next >
BASIC Source File  |  1990-04-09  |  847b  |  21 lines

  1. 'User's Manual Example, Page 258.
  2. CLS
  3.  
  4. DEFINT a-z                        'integer variables are smaller and faster
  5. $COM 1024
  6. OPEN "COM1: 1200,N,8,1" AS #1 LEN = 1024
  7. echo = 1
  8. WHILE (1)                         'loop forever
  9.   WHILE NOT INSTAT                'as long as no key has been pressed
  10.     IF LOC(1) > 0 THEN
  11.       stuff$ = INPUT$(LOC(1),#1)  'read incoming characters
  12.       PRINT stuff$;               'no carriage returns unless sent by
  13.     END IF                        'transmitter
  14.   WEND
  15.   WHILE INSTAT                    'while there are characters at the keyboard
  16.     myinput$ = INKEY$             'get them
  17.     PRINT #1, myinput$;           'send typed characters
  18.     IF echo THEN PRINT myinput$   'display them--maybe unnecessary
  19.   WEND
  20. WEND                              'check for more incoming characters
  21. END