Discussion:
Code Page
(too old to reply)
Roger
2005-04-11 15:52:02 UTC
Permalink
I have re-written a FoxPro DOS system into Visual FoxPro.

I am using free standing tables in the new system.

I will be copying all tables over from the DOS system to the new system.
Do I need to open exclusive in Visual FoxPro each table that I have copied
over and select the Windows radio button or the MS_DOS radio button????
Will my choice effect how these tables function? (Eg speed, etc.)

The tables were originally created in the DOS system that didn't have a Code
Page designation but will only be used in the new Visual FoxPro system.
Thanks for any help you can give me to understand this. The Visual FoxPro
Help was not very helpful.

Roger
Lee Mitchell
2005-04-11 18:06:30 UTC
Permalink
Hi Roger:

Changing the code page should not hinder performance.

This code changes the code page to 1252- Windows ANSI.

LOCAL nNumDBFs, nLoopVar, cCurrDir

cCurrDir = SYS(5) + CURDIR()

WAIT WINDOW "Changing Code Page in " + cCurrDir + " Please Be Patient" ;
NOWAIT NOCLEAR

nNumDBFs = ADIR(aDBFs, "*.DBF")
clear
FOR nLoopVar = 1 TO nNumDBFs

DO HOME() + "\TOOLS\CPZERO\CPZERO" WITH cCurrDir + aDBFs[nLoopVar,1],1252
ENDFOR

WAIT WINDOW "Finished Changing Code Page. Press Any Key To Continue."
** End code


I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP9 HAS ARRIVED!! --*
Read about all the new features of VFP9 here:
http://msdn.microsoft.com/vfoxpro/

*--Purchase VFP 9.0 here:
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by Roger
I have re-written a FoxPro DOS system into Visual FoxPro.
I am using free standing tables in the new system.
I will be copying all tables over from the DOS system to the new system.
Do I need to open exclusive in Visual FoxPro each table that I have copied
over and select the Windows radio button or the MS_DOS radio button????
Will my choice effect how these tables function? (Eg speed, etc.)
The tables were originally created in the DOS system that didn't have a Code
Page designation but will only be used in the new Visual FoxPro system.
Thanks for any help you can give me to understand this. The Visual FoxPro
Help was not very helpful.
Roger
Roger
2005-04-11 18:41:05 UTC
Permalink
Lee,

Thanks for the help!!!

So, when I open the table exclusive I should then select Windows as the Code
Page instead of MS_DOS? Does it matter which one I select?


Hope you are doing well.

Roger
Post by Lee Mitchell
Changing the code page should not hinder performance.
This code changes the code page to 1252- Windows ANSI.
LOCAL nNumDBFs, nLoopVar, cCurrDir
cCurrDir = SYS(5) + CURDIR()
WAIT WINDOW "Changing Code Page in " + cCurrDir + " Please Be Patient" ;
NOWAIT NOCLEAR
nNumDBFs = ADIR(aDBFs, "*.DBF")
clear
FOR nLoopVar = 1 TO nNumDBFs
DO HOME() + "\TOOLS\CPZERO\CPZERO" WITH cCurrDir + aDBFs[nLoopVar,1],1252
ENDFOR
WAIT WINDOW "Finished Changing Code Page. Press Any Key To Continue."
** End code
I hope this helps.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell
*-- VFP9 HAS ARRIVED!! --*
http://msdn.microsoft.com/vfoxpro/
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by Roger
I have re-written a FoxPro DOS system into Visual FoxPro.
I am using free standing tables in the new system.
I will be copying all tables over from the DOS system to the new system.
Do I need to open exclusive in Visual FoxPro each table that I have copied
over and select the Windows radio button or the MS_DOS radio button????
Will my choice effect how these tables function? (Eg speed, etc.)
The tables were originally created in the DOS system that didn't have a
Code
Post by Roger
Page designation but will only be used in the new Visual FoxPro system.
Thanks for any help you can give me to understand this. The Visual FoxPro
Help was not very helpful.
Roger
Dan Freeman
2005-04-11 19:06:23 UTC
Permalink
The fact that you're asking whether it matters means it probably doesn't.
<g>

But instead of Lee's suggestion for actually changing the code page for each
dbf, why not just skip the dialog?

SET CPDIALOG OFF

Won't affect a thing.

Dan
Post by Roger
Lee,
Thanks for the help!!!
So, when I open the table exclusive I should then select Windows as
the Code Page instead of MS_DOS? Does it matter which one I select?
Hope you are doing well.
Roger
Post by Lee Mitchell
Changing the code page should not hinder performance.
This code changes the code page to 1252- Windows ANSI.
LOCAL nNumDBFs, nLoopVar, cCurrDir
cCurrDir = SYS(5) + CURDIR()
WAIT WINDOW "Changing Code Page in " + cCurrDir + " Please Be
Patient" ; NOWAIT NOCLEAR
nNumDBFs = ADIR(aDBFs, "*.DBF")
clear
FOR nLoopVar = 1 TO nNumDBFs
DO HOME() + "\TOOLS\CPZERO\CPZERO" WITH cCurrDir +
aDBFs[nLoopVar,1],1252 ENDFOR
WAIT WINDOW "Finished Changing Code Page. Press Any Key To Continue."
** End code
I hope this helps.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell
*-- VFP9 HAS ARRIVED!! --*
http://msdn.microsoft.com/vfoxpro/
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
Post by Roger
Post by Lee Mitchell
69-4500-8bf2-3f06689f4ab3&type=ovr
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by Roger
I have re-written a FoxPro DOS system into Visual FoxPro.
I am using free standing tables in the new system.
I will be copying all tables over from the DOS system to the new
system. Do I need to open exclusive in Visual FoxPro each table
that I have copied over and select the Windows radio button or the
MS_DOS radio button???? Will my choice effect how these tables
function? (Eg speed, etc.)
The tables were originally created in the DOS system that didn't
have a Code Page designation but will only be used in the new
Visual FoxPro system. Thanks for any help you can give me to
understand this. The Visual FoxPro Help was not very helpful.
Roger
Jeroen van Kalken
2005-04-11 23:04:15 UTC
Permalink
On Mon, 11 Apr 2005 11:41:05 -0700, "Roger"
Post by Roger
Lee,
Thanks for the help!!!
So, when I open the table exclusive I should then select Windows as the Code
Page instead of MS_DOS? Does it matter which one I select?
Depends,Yes

If you have used special characters (accents, linesymbols) in the DBF
when you were using it in DOS, you have to fill in the codepage which
was used in DOS.
Every character is represented internally as a byte (meaning a value
between 0 and 255); the first 127 are standardised and contains the
numerals, keyboard symbols and the characters a-z (upper and
lowercase).
The special characters like é,ü,§ are given a number between 128 and
255, the exact number is dependend on the codepage in use.
e.g. number 129 represents a ü in codepage 437 (=US msdos) but |(an
unkown char) in codepage 1252 (=Windows)
and number 252 represents a ³ in codepage 437 (=US msdos) but ü in
codepage 1252 (=Windows)

So if you set the codepage wrong, all your special characters will be
a mess.
If you do set the codepage to something, VFP will automatically
convert all the charfields to the currently used codepage as soon as
they are read from the DBF (and convert them back when they are
written)
Post by Roger
Post by Lee Mitchell
Changing the code page should not hinder performance.
This code changes the code page to 1252- Windows ANSI.
LOCAL nNumDBFs, nLoopVar, cCurrDir
cCurrDir = SYS(5) + CURDIR()
WAIT WINDOW "Changing Code Page in " + cCurrDir + " Please Be Patient" ;
NOWAIT NOCLEAR
nNumDBFs = ADIR(aDBFs, "*.DBF")
clear
FOR nLoopVar = 1 TO nNumDBFs
DO HOME() + "\TOOLS\CPZERO\CPZERO" WITH cCurrDir + aDBFs[nLoopVar,1],1252
ENDFOR
WAIT WINDOW "Finished Changing Code Page. Press Any Key To Continue."
** End code
I hope this helps.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell
*-- VFP9 HAS ARRIVED!! --*
http://msdn.microsoft.com/vfoxpro/
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by Roger
I have re-written a FoxPro DOS system into Visual FoxPro.
I am using free standing tables in the new system.
I will be copying all tables over from the DOS system to the new system.
Do I need to open exclusive in Visual FoxPro each table that I have copied
over and select the Windows radio button or the MS_DOS radio button????
Will my choice effect how these tables function? (Eg speed, etc.)
The tables were originally created in the DOS system that didn't have a
Code
Post by Roger
Page designation but will only be used in the new Visual FoxPro system.
Thanks for any help you can give me to understand this. The Visual FoxPro
Help was not very helpful.
Roger
Mariano Donaldson
2005-04-19 14:42:49 UTC
Permalink
Roger

I've found that the best solution is:

SET CPDIALOG OFF

and

CODEPAGE=850 on the config.fpw

HTH

Mariano Donaldson
***@fibertel.com.ar
Buenos Aires, Argentina
Post by Roger
I have re-written a FoxPro DOS system into Visual FoxPro.
I am using free standing tables in the new system.
I will be copying all tables over from the DOS system to the new system.
Do I need to open exclusive in Visual FoxPro each table that I have copied
over and select the Windows radio button or the MS_DOS radio button????
Will my choice effect how these tables function? (Eg speed, etc.)
The tables were originally created in the DOS system that didn't have a Code
Page designation but will only be used in the new Visual FoxPro system.
Thanks for any help you can give me to understand this. The Visual FoxPro
Help was not very helpful.
Roger
Loading...