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.

Sys(2300)

This function, added in VFP 7, lets you control whether a particular code page is included in the list of languages given National Language Support.

Usage

cSupported = SYS( 2300, nCodePage [, nAction ] )

Parameter

Value

Meaning

nCodePage

Numeric

The code page whose status you want to check or set.

nAction

0

Turn off support for the specified code page.

1

Turn on support for the specified code page.

cSupported

"0"

The specified code page is not supported at this time.

"1"

The specified code page is supported at this time.

Code pages provide the mapping between the numbers from 0 to 255 and the characters they represent. Different code pages hold the characters for different languages. But when dealing with languages other than English, you also need to address the sorting order (collation sequence) of the characters, as well as issues of comparing characters.

FoxPro has had support for code pages and collation sequences for a long time, but it’s expanded in VFP 7. In previous versions, some collation sequences were available without their corresponding code pages. Now, you can decide which of those code pages to include.

Why not just add the code pages directly? Because doing so would break old code that dealt with the lack of code page support. So, instead, in the long FoxPro tradition, you get to decide whether to do it the new way or the old way.

Example

* Add support for the Russian Windows code page.
cWasSupported = SYS(2300, 1250, 1)

See Also

CPConvert(), CPCurrent(), CPDBF(), Double-Byte Character Sets, GetCP(), IDXCollate(), Set Collate, Set CPCompile, Set CPDialog, Set NoCPTrans