Microsoft KB Archive/21311

= How DEFINT, DEFSNG, DEFDBL Affect Type of DEF FN Function =

Article ID: 21311

Article Last Modified on 11/21/2006



This article was previously published under Q21311



SUMMARY
This article discusses the default type declaration of DEF FN user-defined functions in Microsoft Basic.

The DEFINT, DEFLNG, DEFDBL, and DEFSNG statements affect the first letter of the variable part of a DEF FN function name, and not the FN part of the function name. This information applies to all Microsoft Basic compilers and interpreters for MS-DOS, MS OS/2, Macintosh, and CP/M-80.

Microsoft Basic Compiler versions 6.00 and later, and QuickBasic versions 4.00 and later for the IBM PC, introduced the DEFLNG statement for long integer declaration, which also behaves this way.



Example
The following program prints 1.2 (a noninteger): 10 DEFINT F  ' DEFINT F doesn't affect the DEF FN below. 20 DEF FNAB=1.2 30 PRINT FNAB The following program prints 1 (truncated to an integer): 10 DEFINT A  ' DEFINT A does affect the DEF FN below. 20 DEF FNAB=1.2 30 PRINT FNAB

Additional query words: QuickBas BasicCom

Keywords: KB21311

-

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

© Microsoft Corporation. All rights reserved.