Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

CodePage

This property contains the codepage assigned to a file.

Usage

nCodePage = filFile.CodePage

The codepage associated with a file indicates its underlying character set. This property lets you find out which one it is.

You can’t set a file’s codepage by changing this property, which sort of makes sense to us, because the project doesn’t own the file. The same file might be part of dozens of projects and must have the same codepage regardless of project. If you want to set a file’s codepage, check out COPY TO. On the other hand, you can change the codepage of files other than DBFs through the Project Manager interface, and the same arguments apply there. So we’re confused about the disparity.

Example

? oProj.Files[3].CodePage

See Also

Copy To, CPDBF(), CPCurrent(), File, Project