Microsoft KB Archive/94831

= Undocumented Error: Too many local strings in Sub/Function =

Article ID: 94831

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft Visual Basic for MS-DOS
 * Microsoft BASIC Professional Development System 7.0
 * Microsoft BASIC Professional Development System 7.1

-



This article was previously published under Q94831



SYMPTOMS
In Visual Basic for MS-DOS, the following BC.EXE compiler error can occur when a program has over 255 variable-length strings allocated in a procedure:

Too many local strings in Sub/Function

This includes Dim statements as well as compiler-generated local temporary variables. The same limit applies to the Basic Professional Development System when compiling for far strings (BC /Fs option), but no error occurs. This limit does not apply to the VBDOS.EXE and QBX.EXE interpreter environments.



WORKAROUND
To work around the problem, reduce the number of local strings in the procedure.



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



MORE INFORMATION
The following program demonstrates this limit by declaring 300 variable- length string variables. Sub s     Dim a1$ Dim a2$ ...     Dim a300$ End Sub

This program gives the error &quot;Too many local strings in Sub/Function&quot; when compiled in Visual Basic for MS-DOS, but it runs without an error message when compiled in the Basic Professional Development System. However, in the Basic Professional Development System if you use more than 255 variable-length strings, the strings may become corrupted.

Additional query words: VBmsdos 1.00 7.10 buglist7.10 fixlist1.00

Keywords: KB94831

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.