Microsoft KB Archive/115289

{| = PRB: FSIZE Returns 0 or "File Does Not Exist" =
 * width="100%"|

ID: Q115289

The information in this article applies to:


 * Microsoft FoxPro for Windows, version 2.6
 * Microsoft FoxPro for MS-DOS, version 2.6

SYMPTOMS
The FSIZE function either returns a value of 0 or the following error message:

File does not exist.

CAUSE
The FSIZE function is using the wrong parameter for the current state of the SET COMPATIBLE statement.

When SET COMPATIBLE is OFF or FOXPLUS, the FSIZE function returns the size of the specified field in the currently used table.

When SET COMPATIBLE is ON or DB4, the FSIZE function returns the size of the specified file.

FSIZE Returns 0 for Size of File
If the FSIZE function is attempting to determine the size of a file, do one of the following:

 Change the SET COMPATIBLE setting to ON or DB4 so that FSIZE returns the file size (dBASE behavior). -or- Use the ADIR function instead of FSIZE to determine the file size when SET COMPATIBLE is OFF or FOXPLUS.

For additional information about using ADIR to obtain a file size, please see the following article(s) in the Microsoft Knowledge Base: ARTICLE-ID: Q100554 TITLE: Using ADIR Function to Obtain MS-DOS File Information

FSIZE Returns "File Does Not Exist"
If the FSIZE function is attempting to determine the size of a field in a table, change the SET COMPATIBLE setting to OFF or FOXPLUS so that FSIZE returns a field size (FoxPro behavior).

NOTE: Changing the SET COMPATIBLE setting may affect other commands and functions in the program.

MORE INFORMATION
The SET COMPATIBLE statement does not affect the behavior of the FSIZE function in previous versions of FoxPro.

Additional reference words: FoxDos FoxWin 2.60 errmsg err msg zero KBCategory: kbprg kberrmsg kbprb KBSubcategory: FxprgGeneral
 * }