home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / basic / baswiz18.zip / BW$BAS.ZIP / TCQ.BAS < prev    next >
BASIC Source File  |  1992-08-29  |  1KB  |  35 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |        BASWIZ  Copyright (c) 1990-1992  Thomas G. Hanlin III         |
  4. '   |                                                                      |
  5. '   |                      The BASIC Wizard's Library                      |
  6. '   |                                                                      |
  7. '   +----------------------------------------------------------------------+
  8.  
  9.    DECLARE SUB TCDone0 ()
  10.    DECLARE SUB TCInit0 (BYVAL Port%, BYVAL InBuf%, BYVAL OutBuf%, ErrCode%)
  11.    DECLARE SUB TCParms0 (BYVAL Parity%, BYVAL WordLength%, BYVAL StopBits%)
  12.  
  13.    DEFINT A-Z
  14.  
  15. SUB TCDone
  16.    TCDone0
  17.    junk& = SETMEM(999999)
  18. END SUB
  19.  
  20. SUB TCInit(Port, InBuf, OutBuf, ErrCode)
  21.    junk& = SETMEM(-(CLNG(InBuf) + CLNG(OutBuf) + 64&))
  22.    TCInit0 Port, InBuf, OutBuf, ErrCode
  23. END SUB
  24.  
  25. SUB TCParms(Parity$, WordLength%, StopBits%)
  26.    SELECT CASE UCASE$(LEFT$(Parity$, 1))
  27.       CASE "S": Parity = 4                   ' space (parity = 0)
  28.       CASE "M": Parity = 3                   ' mark  (parity = 1)
  29.       CASE "E": Parity = 2                   ' even parity
  30.       CASE "O": Parity = 1                   ' odd parity
  31.       CASE ELSE: Parity = 0                  ' no parity
  32.    END SELECT
  33.    TCParms0 Parity, WordLength, StopBits
  34. END SUB
  35.