BUG: Subpgm Run-time "Error 35": Compiled w/ Line Length=255 (75413)






This article was previously published under Q75413

SYMPTOMS

Attempting to run a compiled program that contains a line exactly 255 characters in length may result in run-time "Error 35" ("Undefined subprogram"). This problem will occur if a line exactly 255 characters in length is placed between a call to a subprogram and the SUB statement itself. This problem occurs for a program compiled under Microsoft QuickBasic for Macintosh . This problem does not occur in the QuickBasic development environment.

Microsoft has confirmed this to be a bug with programs compiled with Microsoft QuickBasic versions 1.0, 1.0a and 1.0b for the Apple Macintosh. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The QuickBasic environment (interpreter) supports a line length of 255 characters. Attempting to exceed this line length correctly gives a "Line too long" error while editing in the QuickBasic environment. The compiler will compile a line of exactly 255 characters without error, but the resulting compiled program may fail with an "Error 35" ("Undefined subprogram") at run-time if the line appears anywhere between a call to a SUB program and the SUB program itself.

The only workaround for this problem is to shorten the 255-character line to 254 characters or less.

Below is a code example that demonstrates the problem:
CALL TEMP
'The line below must contain exactly 255 characters for the problem to
'occur:
'Put 254 X's here after the remark (the ' counts as one character).
END

SUB TEMP STATIC
END SUB
				

Modification Type: Minor Last Reviewed: 1/8/2003
Keywords: kbbug KB75413