Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Codepage switching
#1
My Quickbasic programs date back to the earlier 1990's and I recently gave a talk on programming in Quickbasic to my local Amateur Radio Club. various programs were demonstrated on a PC which runs only MS-DOS 6.22 and which is the only PC I use for QuickBasic.

I have since been asked for copies of several of my programs, alas at the time they were written a PC in the UK booted up using codepage 437, and so I used extended characters which were applicable to electronics, viz: 227, 230, 232, 233, 234, 235 and 237. Nowadays PC's in the UK boot up using codepage 850 and the extended characters are totally different.

Is there a way to change codepages?
Reply
#2
In Windows XP: No. In Windows 98: through CONFIG.SYS and AUTOEXEC.BAT. Check HELP.COM for "MODE". It should look something like:

Code:
mode con codepage prepare="437"
mode con codepage select="437"

But I'm not sure at all.

Anyhow, 437 is the default CP, so if your Windows 98/95/MSDOS machine boots with CP 850 you just have to delete the aforementioned lines.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#3
Wasn't there a COUNTRY.SYS or KEYB.SYS or something like that that also changed the codepage?
I'd knock on wood, but my desk is particle board.
Reply
#4
Yeah, you had to load country.sys in CONFIG.SYS... It was kinda puzzling. But honestly I can't tell, I don't have any DOS/Win9X machine here to test it/check it out.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#5
Alun,
Sounds like a sticky problem. What I understand is that your programs use hardcoded extended characters which correspond to the 437 codepage. Even if you mastered the autoexec and config commands to boot up your friends' machines to use 437, you can't really expect them to be changing their autoexec and config files just to be able to run your programs. Booting from a floppy might be an alternate solution, though.

If you don't have too many programs, and there aren't too many references to the extended characters, you might consider creating a code conversion file for the particular extended characters that you use. Your programs would then blindly read in the conversion file and store it in arrray. When you need to use an extended character, get the corresponding one from the array.

Either you or your friends could set up the code conversion file to match the particular codepage characters of their machine.

It may be extra work at first, but it beats fiddling with all the autoexec and config commands on the variety of DOS versions or Windows versions that your friends might be running.

Think about it.
*****
Reply
#6
Code:
MODE devicename CODEPAGE PREPARE=((yyy [...]) [drive:][path]filename)
Code:
MODE devicename CODEPAGE SELECT=yyy
Code:
MODE devicename CODEPAGE REFRESH

...and...

Code:
MODE devicename CODEPAGE [/STATUS]

...if my memory serves me well. About the codes (yyy):

Code:
437 United States
850 Latin I
852 Latín II
860 Portuguese
863 Canada (French)
865 Nordic

How to use that? For example...

Code:
mode con codepage prepare=((850) C:\WINDOWS\COMMAND\ega.cpi)
mode con codepage select=850

...this' from *my* AUTOEXEC.BAT. Just guess which keyboard scheme I'm using. :wink:
img]http://usuarios.vtr.net/~disaster/sigs/annoyizer.php[/img]
Reply
#7
Many thanks for your replies. I played around with Autoexec.bat and Config.sys on my PC and managed to boot up with CP437, but Moneo has hit the nail on the head, it's my friends computers I need to change in order to run my programs, and has he points out I cannot expect them to change their Autoexec and Config files each time they wish to run my programs. So what is required is possibly a bat file which informs the user that his/her PC has to be rebooted, reboots the PC using CP437, call the QuickBasic program and on exit reboots the PC to use CP850.

Merry Christmas to all
Reply
#8
Your choice is the, as moneo has pointed out, setting up a bootable diskette which runs your programs (with a menu, etc).

You could then distribute your disk as a image that people could copy to a disk using rawrite or something like that.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#9
Alun,
The batchfile that you mention is going to be very tricky, and maybe not possible given your friends' different machine environments. You would need tailored versions of the batchfile, which is going to be tedious, plus you won't have the chance to test these on your own machine.

What I suggest is that you have a self-contained bootable diskette that has your programs plus all the MSDOS stuff you need to boot up with the codepage 437 that your programs need. This is of course assuming that your programs fit on a diskette with the MSDOS stuff, and that they don't make explicit references to the C: drive.

Then, your friends boot off of the diskette, run your programs, and when they're done remove the diskette and re-boot their machine.

However, if your programs use any workfiles which might exceed the capacity of a diskette, you will have to resort to installing your programs on the fly onto some directory on the C: drive, and run them from the C: drive. This process also could get tedious.
*****
Reply
#10
Couldn't you just redefine all the characters to those of the desired code page...?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)