"Illegal Function Call" with TAB & LOCATE in Compiled Program (61673)






This article was previously published under Q61673

SYMPTOMS

This article documents a special case where the TAB function placed between two LOCATE statements causes an "Illegal Function Call" in a subroutine. This problem occurs only in a compiled (.EXE) program using QuickBasic version 4.50.

STATUS

Microsoft has confirmed this to be a bug in Microsoft QuickBasic version 4.50. This problem was corrected in Microsoft Basic Professional Development System (PDS) version 7.00 for MS-DOS (fixlist7.00).

This problem does not occur in Microsoft QuickBasic versions 4.00 or 4.00b or in Microsoft Basic Compiler versions 6.00 and 6.00b for MS-DOS.

MORE INFORMATION

The problem does not occur if you do one or both of the following:

  1. Remove the TAB function from between the Locate statements. Instead of TAB, use a literal such as " " with the appropriate number of spaces, or use the STRING$() function.
  2. Compile with /x.

Code Example

   ' Compile line: BC tab.bas;
   ' Link line:    LINK tab ;

   DECLARE SUB test (col)
   CALL test(20)

   SUB test (col)
       LOCATE col, 1
       PRINT TAB(2);
       LOCATE col, 1     'This line gives the "Illegal Function call"
   END SUB
				

Modification Type: Minor Last Reviewed: 1/8/2003
Keywords: KB61673