COMMON SHARED Problem when Period in Variable after CHAIN (33622)






This article was previously published under Q33622

SYMPTOMS

When CHAINed inside the QuickBasic Version 4.00b or Version 4.50 editor, the following programs fail to pass the COMMON SHARED variable m$. There are no error messages at compile time or run time. The CHAINed program uses a period in an array name that appears to conflict with a separate user-defined type. Neither the array nor the user-defined type variable is passed in COMMON. The programs run correctly in QuickBasic Version 4.00 or when run from an .EXE program compiled in Version 4.00b or Version 4.50.

STATUS

Microsoft has confirmed this to be a bug in QuickBasic Versions 4.00b and 4.50. This problem was corrected in the QBX.EXE environment of the Microsoft Basic PDS Version 7.00 (fixlist7.00).

MORE INFORMATION

The following is a code example:
   'The CHAINing program, PROG1.BAS:
   COMMON SHARED m$
   m$ = "Nice to see you.  Sometimes I don't print, but I should!"
   CHAIN "prog2"

   'The CHAINed-to program, PROG2.BAS:
   COMMON SHARED m$
   TYPE t
     a AS INTEGER
   END TYPE
   DIM c.n(5)    'If the period is taken out, it works correctly.
   DIM d AS t    'If this line is taken out, or if d is DIMmed to
                 'something else, it works correctly.
   PRINT m$

				

Modification Type: Minor Last Reviewed: 1/9/2003
Keywords: KB33622