home *** CD-ROM | disk | FTP | other *** search
- ' Small terminal program to demonstrate the use of FOSSIL45 in a Quickbasic
- ' program.
-
- REM $INCLUDE: 'FOSSIL45.BI'
-
- Init 0 ' Initialize driver for port 0
- GOSUB CheckErr ' Check for errors
- SetBaud 0, 9600, 8, "N", 1 ' Set baud rate, word length, parity, stop bits
- GOSUB CheckErr
- FlowCtl 0, 1 ' Set flow control to RTS/CTS
- GOSUB CheckErr
-
- DO
- PRINT Receive(0, 0); ' Print any received characters
- GOSUB CheckErr
- a$ = INKEY$
- Transmit 0, a$ ' Transmit any typed characters
- GOSUB CheckErr
- LOOP UNTIL a$ = "*" ' Exit loop if * is typed
-
- Dinit 0 ' De-initialize driver for port 0
- GOSUB CheckErr
- END
-
- CheckErr: ' Error checking routine
- IF FossErr = 0 THEN RETURN ' No errors? Return to main program
- PRINT
- PRINT "Error Number "; FossErr; "accessing port"; PortErr
- Dinit 0 ' De-initialize driver for port 0
- END
-
-