Cannot Use FN at Beginning of SUB or Variable Names (40859)



The information in this article applies to:

  • Microsoft QuickBASIC 2.0
  • Microsoft QuickBASIC 2.01
  • Microsoft QuickBASIC 3.0
  • Microsoft QuickBASIC 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBASIC 4.5
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0

This article was previously published under Q40859

SUMMARY

In Microsoft QuickBasic, the FN character combination is reserved for user-defined functions created with the DEF FN statement. Variable names, SUBprogram procedure names, and function procedure names defined with the FUNCTION statement may NOT use FN as the first characters in the name.

Depending on usage, QuickBasic can give you errors such as the following when you incorrectly use FN in a name:

Duplicate definition
Invalid identifier
Cannot start with FN
Function not defined

The variable, SUBprogram, or FUNCTION should be renamed so that it does not start with the FN character combination.

This information applies to Microsoft QuickBasic Versions 2.00, 2.01, 3.00, 4.00, 4.00b, and 4.50, to Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS and MS OS/2, and to Microsoft Basic PDS Version 7.00 for MS-DOS and MS OS/2.

More information on the DEF FN statement can be found in the Microsoft Basic language reference manual for your version of Basic or QuickBasic.

Modification Type:MinorLast Reviewed:1/9/2003
Keywords:KB40859