Specifies the character set used for encoding or decoding an object. For the File object, the property is read-only. For XML objects, the property is read-write at design time and run time.
oXMLAdapter.CodePage = nValue oXMLTable.CodePage = nValue oXMLField.CodePage = nNvalue oFileObject.CodePage
- oXMLAdapter, oXMLTable, oXMLField
- XML objects that support code pages.
- Object representing a file in a Visual FoxPro project.
- Numeric value associated with a code page. For XML objects, the default value is zero (0).
A numeric value indicates the character set used for the object. Code pages usually correspond to different platforms and languages and are used in international applications.
When you use the LoadXML or Attach methods to load an XML document, the XMLAdapter object processes the XML to determine the CodePage property. If the XMLAdapter object is unable to determine the code page or the code page is not on the list of supported code pages, the CodePage property is set to zero (0).
This example counts how many project files are using code page 1252 (ANSI Windows).
nCode1252=0 MODIFY PROJECT myproject NOWAIT FOR i = 1 TO _VFP.ActiveProject.Files.Count IF _VFP.ActiveProject.Files(i).CodePage = 1252 nCode1252=nCode1252+1 ENDIF ENDFOR ?nCode1252 && Show the count in the Visual FoxPro screen.