CND-DET routines 4/8

 BBS: Inland Empire Archive
Date: 03-25-93 (15:34)             Number: 289
From: DIRK THEURER                 Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: CND-DET routines 4/8           Conf: (2) Quik_Bas
'
' CND-DET routines (part 4)
'
  '
  ' initialize function value
  '
  GetCNDNumber% = 0
  '
  ' main loop checks for incoming CND data or keyboard data
  '
  ' start of loop
  '   if incoming CND data
  '     process data (ignore keyboard)
  '   if keyboard data
  '     process keyboard data (ignore CND)
  ' end of loop
  '

  DO
    '
    ' check for incoming CND data
    '
    i$ = GetChar$
    IF i$ <> "" THEN
      SELECT CASE ASC(i$)

        CASE 85 ' U

          IF NoOfUs = 0 THEN
            Junk = False
          ELSE
            IF Junk THEN
              '
              ' fatal error - junk in middle of "U"s stream
              '
              FOR i = 1 TO 500: NEXT i
              FOSSILFlush
              GetCNDNumber% = 3
              EXIT FUNCTION
            END IF
          END IF
          NoOfUs = NoOfUs + 1

        CASE 4  ' CTRL-D

          IF NoOfUs THEN
            IF NOT Junk THEN
              IF NoOfUs <> 30 THEN
                '
                ' non-fatal error in data stream?
                ' (at least till someone tells me otherwise)
                '
                CND.CNDAttrib = 10
              END IF
            ELSE
              '
              ' fatal error - got junk between "U"s and CTRL-D
              '
              FOR i = 1 TO 500: NEXT i
              FOSSILFlush
              GetCNDNumber% = 4
              EXIT FUNCTION
            END IF
'
' Continues...
'



---
 * Origin: RAVE * Burnaby, BC (1:153/810)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET