home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boston 2
/
boston-2.iso
/
DOS
/
PROGRAM
/
BASIC
/
POWBASIC
/
LIBRARY1
/
EXAMP1.ZIP
/
UMEX258.BAS
< prev
next >
Wrap
BASIC Source File
|
1990-04-09
|
847b
|
21 lines
'User's Manual Example, Page 258.
CLS
DEFINT a-z 'integer variables are smaller and faster
$COM 1024
OPEN "COM1: 1200,N,8,1" AS #1 LEN = 1024
echo = 1
WHILE (1) 'loop forever
WHILE NOT INSTAT 'as long as no key has been pressed
IF LOC(1) > 0 THEN
stuff$ = INPUT$(LOC(1),#1) 'read incoming characters
PRINT stuff$; 'no carriage returns unless sent by
END IF 'transmitter
WEND
WHILE INSTAT 'while there are characters at the keyboard
myinput$ = INKEY$ 'get them
PRINT #1, myinput$; 'send typed characters
IF echo THEN PRINT myinput$ 'display them--maybe unnecessary
WEND
WEND 'check for more incoming characters
END