Posts: 14
Threads: 1
Joined: Dec 2003
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?
Posts: 6,419
Threads: 74
Joined: Mar 2002
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.
Posts: 3,279
Threads: 170
Joined: Nov 2003
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.
Posts: 6,419
Threads: 74
Joined: Mar 2002
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.
Posts: 1,956
Threads: 65
Joined: Jun 2003
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.
*****
Posts: 749
Threads: 4
Joined: Jun 2002
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]
Posts: 14
Threads: 1
Joined: Dec 2003
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
Posts: 6,419
Threads: 74
Joined: Mar 2002
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.
Posts: 1,956
Threads: 65
Joined: Jun 2003
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.
*****
Posts: 1,752
Threads: 21
Joined: Jun 2002
Couldn't you just redefine all the characters to those of the desired code page...?