How I can convert DOS texts to Windows
Probably first step of DOS to Windows migration is converting DOS texts to Windows.
“Text” may be .prg, .txt or anything else plain text files or tables ( .dbf files ) include Character or MEMO type fields.
This operation will be necessary because foreign ( non English ) characters are different in DOS and Windows.
Fortunately we have Harbour functions to use this purpose: HB_OEMTOANSI() and WIN_OEMTOANSI().
Texts files :
cDOS_FName := "MyDOS_xxx.txt"
cWIN_FName := "MyWIN_xxx.txt"
cSourceText := MEMOREAD( cDOS_FName )
cTargetText := HB_OEMTOANSI( cSourceText )
MEMOWRIT( cWIN_FName, cTargetText )
REPLACE ALL TEXT_FIELD WITH HB_OEMTOANSI( TEXT_FIELD )
– Don’t worry about file sizes; 64K limit remain in DOS. However you can use line based processing.
– Recommended :
– Use WIN_OEMTOANSI( ) instead of HB_OEMTOANSI()
– Inverse functions are WIN_ANSITOOEM( ) and HB_ANSITOOEM( )