Article ID: 42470
Article Last Modified on 11/21/2006
APPLIES TO
- Microsoft QuickBasic 4.5 for MS-DOS
This article was previously published under Q42470
SYMPTOMS
If two programs are compiled with the BC /O (stand-alone option), and the first program CHAINs to the second program with the following CHAIN statement, then the program fails to give an error message for the ".BAS" extension:
CHAIN "prog2.BAS"
The CHAIN is not executed, and program execution either ends or hangs the machine.
The correct response should be the following run-time error:
This information applies only to programs compiled with the stand-alone (/O) switch in QuickBasic Version 4.50. The debug (/D) switch does not change the problem. If compiled requiring BRUN45, the problem does not occur. The problem also doesn't occur with QuickBasic Version 4.00 or 4.00b or Microsoft Basic Compiler Version 6.00 or 6.00b.
STATUS
Microsoft has confirmed this to be a bug in QuickBasic Version 4.50. This problem was corrected in Microsoft Basic Professional Development System (PDS) Version 7.00, (fixlist7.00).
In Microsoft Basic PDS 7.00, the run-time error message generated is as follows:
To work around the problem, do not include an extension on the program name in the CHAIN statement. QB.EXE and BC.EXE are able to determine which program to CHAIN to if there are two files with the same name but different extensions:
CHAIN "PROG2" will CHAIN to PROG2.BAS in QB.EXE
CHAIN "PROG2" will CHAIN to PROG2.EXE in BC.EXE
MORE INFORMATION
Code Example
Compiling the following two programs with BC /O demonstrates the problem:
'*** PROGRAM #1 (PROG1.EXE) '************ PRINT "CHAINing to PROGRAM #2" CHAIN "prog2.bas" END '*** PROGRAM #2 (PROG2.EXE) '************** PRINT "INSIDE PROGRAM #2" END
Additional query words: QuickBas SR# S890217-22 buglist4.50
Keywords: KB42470