Microsoft KB Archive/45896

From BetaArchive Wiki
Knowledge Base

Variable Names Starting with "FN" Give "Syntax Error"

Article ID: 45896

Article Last Modified on 12/12/2003


  • Microsoft QuickBasic Compiler for Macintosh 1.0
  • Microsoft BASIC Interpreter 2.0
  • Microsoft BASIC Interpreter 2.1 for Macintosh
  • Microsoft BASIC Interpreter 3.0 for Macintosh

This article was previously published under Q45896


Using a variable name that begins with the letters "FN" (capital or lowercase) results in a "Syntax Error" when you run the program or when you attempt to compile the program. To avoid this situation, use a different variable name.

This information applies to Microsoft QuickBASIC Version 1.00 for the Apple Macintosh System, Microsoft BASIC Interpreter Versions 2.00, 2.10, and 3.00 for the Apple Macintosh System, and Microsoft BASIC Compiler Version 1.00 for the Apple Macintosh System.

This is not considered a problem of any of these Microsoft products.


A variable that begins with the letters FN or fn is assumed to be a function that was previously defined with the DEF FN statement.

This is not directly stated in the manual, but it is implied in the DEF FN statement documentation (as on Page 98 of "Microsoft QuickBASIC for Apple Macintosh: Language Reference."

To demonstrate a "Syntax Error," enter a line of code that references a variable name that begins with "FN". If you enter the variable name in lowercase letters, the "FN" is automatically capitalized by QuickBASIC. Run the program, and the line containing that variable name will be flagged as a "Syntax Error"; for example, the following statement generates the error:

        FNxt$ = "hello"

Additional query words: BasicCom MQuickB

Keywords: KB45896