BC.EXE Gives Element Not Defined Error w/ REM $INCLUDE in TYPE (85287)



The information in this article applies to:

  • Microsoft Basic Professional Development System for MS-DOS 7.1
  • Microsoft Basic Professional Development System for MS-DOS 7.0

This article was previously published under Q85287

SYMPTOMS

The BC.EXE compiler incorrectly reports the error "Element not defined" if you use a REM $INCLUDE statement within the TYPE/END TYPE statement block. The problem does not occur in QBX.EXE.

STATUS

Microsoft has confirmed this to be a bug in the BC.EXE compiler of Microsoft Basic Professional Development System (PDS) for MS-DOS, versions 7.0 and 7.1. This problem was corrected in Microsoft Visual Basic version 1.0 for MS-DOS.

MORE INFORMATION

If the TYPE/END TYPE statement block only contains a REM $INCLUDE statement, the error occurs on the END TYPE statement. If the TYPE/END TYPE statement block contains a REM $INCLUDE statement in addition to normal element declarations, the error occurs where you refer to the members declared in the include file.

The problem does not occur in Microsoft QuickBasic for MS-DOS, version 4.5.

Steps to Reproduce Problem

  1. Enter the following statements into a module named T.BAS:
          TYPE t
              s AS STRING * 10
          REM $INCLUDE: 'T.BI'
          END TYPE
          DIM v AS t
          v.s = "hello"
          v.i = 123      ' BC.EXE reports "Element not defined".
  2. Enter the following element declaration into an include file named T.BI:
          i AS INTEGER
  3. Compile the the following program:
          BC T.BAS;
    						
    BC.EXE reports "Element not defined."

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB85287 kbAudDeveloper