"String Formula Too Complex" Using UCASE$(COMMAND$) (72681)



The information in this article applies to:

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

This article was previously published under Q72681

SYMPTOMS

When you repeatedly invoke the UCASE$ function using the COMMAND$ function as its argument, a "String Formula Too Complex" error can occur.

STATUS

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

To work around the problem, assign COMMAND$ to a temporary string variable, and pass the temporary string variable to the UCASE$ function.

MORE INFORMATION

The following program reproduces this problem:

Code Example

CLS
FOR i% = 1 to 100
 
     LOCATE 1, 1: PRINT i%
     temp$ = UCASE$(COMMAND$)
 
NEXT i%
END
				
The above program will fail on the 21st iteration of the loop. To work around this problem, assign COMMAND$ to temp$ and then take the UCASE$ of temp$:
   temp$ = COMMAND$
   temp$ = UCASE(temp$)
				
NOTE: The problem also occurs if you replace UCASE$ with LCASE$.

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB72681