Article ID: 38498
Article Last Modified on 11/21/2006
This article was previously published under Q38498
SYMPTOMS
The program below, which runs properly inside the QuickBasic Version 4.50 environment, will generate an "Expression too complex" error message when compiled with BC.EXE.
STATUS
Microsoft has confirmed this to be a bug in BC.EXE in QuickBasic Version 4.50. We are researching this problem and will post new information as it becomes available.
The program compiles and executes properly in Microsoft QuickBasic Versions 4.00 and 4.00b.
MORE INFORMATION
When the program listed below is compiled using BC.EXE, either from the DOS command line, or from the QuickBasic environment with "Make .EXE File..." option, an "Expression too complex" error message is generated on the END SUB statement. The problem does not occur if the expression in the subprogram is simplified in any way (such as breaking the expression into two parts, using temporary variables, etc.), or if the array values in the subprogram are SHARED rather than passed as parameters.
To avoid the problem, either break the expression in the subprogram down, using multiple expressions and temporary variables, or make the arrays SHARED rather than passed to the subprogram as parameters.
The following is a code example:
DEFINT A-Z DECLARE SUB cd (cur(), c(), b(), sn, l()) DIM b(10), c(1, 10), cur(10, 2, 1, 6) DIM l(10) PRINT "This is a test." END 'Note that the subprogram does NOT have to be CALLED 'to reproduce the problem SUB cd (cur(), c(), b(), sn, l()) mp = cur(l(sn), 0, 1, c(0, sn)) - 1 END SUB
Additional query words: QuickBas buglist4.50
Keywords: KB38498