Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code Pages
Message
From
11/09/1997 23:05:54
 
 
To
10/09/1997 17:10:53
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00049416
Message ID:
00049742
Views:
119
>>>>I am about to deliver a VFP 3.0b app to a customer, but the app will be inserting data into 2 EXISTING Clipper .dbf tables. When I tested the app, the first time it opened these tables (exclusive use is necessary), a code page was prompted for. Is there any way I can automatically set the code page for these tables so the user will not have to figure out which one to pick when the dialogue pops up? If so, how?

from VFP help:

If a .DBF file does not display properly, it might have the wrong code page mark. You can remove the code page mark with the CPZERO program located in the Visual FoxPro TOOLS\CPZERO directory. Running CPZERO sets the code page to 0, meaning none.

To remove a code page mark

· Run CPZERO using the following syntax

DO CPZERO [WITH "filename"[, codepage_number]]

Note When you remove the code page mark of a .DBF file, the data in the file doesn't change. To change the code page of the data, you must mark the file with the proper code page.

Do the above and set cpdialog off so that VFP never asks the user to set the codepage.

>>>>
>>>>TIA.
>>>
>>>What about SET CPDIALOG OFF?
>>
>>I considered that option, but if a CP definition is required, won't VFP ask for one anyway? Is one necessarily required?
>>
>>How can you be so fast responding to these so consistently?? :)
>>
>>Thanks
>
>I guess SET CPDIALOG OFF maens 'use default codepage'. BTW, MS reminds: 'In your completed application, be sure that SET CPDIALOG is OFF'.

When a table is created, the current codepage is imbedded in the header. VFP never changes the codepage setting of a table automatically, this could turn good data into garbage because there is character remapping that happens when the codepage is set or changed.

Returns the code page setting (if any) in your Visual FoxPro configuration file, or returns the current operating system code page.

The following VFP help explains more:

Syntax

CPCURRENT([1 | 2])

Remarks

CPCURRENT( ) returns one of the following:

· In Visual FoxPro, the current operating system code page if the CODEPAGE configuration item isn't included in your configuration file. In previous versions of FoxPro, 0 is returned if the CODEPAGE configuration item isn't included in your configuration file
· The code page number specified in the CODEPAGE configuration item. For example, CPCURRENT( ) returns 852 if the following line is included in your configuration file:

CODEPAGE = 852

· The current operating system code page if you have included the following line in your configuration file:

CODEPAGE = AUTO

In Visual FoxPro, CPCURRENT(1) returns the Windows code page, regardless of your configuration CODEPAGE setting. In other platform versions of FoxPro, CPCURRENT(1) returns the current operating system code page, regardless of your configuration CODEPAGE setting.
CPCURRENT(2) always returns the underlying operating system code page, regardless of your configuration CODEPAGE setting. For example, if you're running Windows, CPCURRENT(2) returns the MS-DOS code page.
For additional information on code pages and Visual FoxPro's international support, see Code Pages Supported by Visual FoxPro, and Chapter 20, "Developing International Applications," in the Developer's Guide.
Previous
Reply
Map
View

Click here to load this message in the networking platform