You are currently offline, waiting for your internet to reconnect

Converting Programs from GW-Basic to QBasic

This article was previously published under Q72502
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
To run a GW-Basic program under QBasic, do the following:
  1. Convert the program in GW-Basic to ASCII format.
  2. Run QBasic with the /MBF switch.
  3. Load the program into QBasic.
All QBasic programs must be in ASCII format. The GW-Basic programeditor can save programs in the format QBasic requires. The file mustbe saved with the A option in GW-Basic. Otherwise, GW-Basic compressesthe text of your program into a format that QBasic cannot read.

To convert the file to the QBasic format, do the following:
  1. Run GW-Basic.
  2. Use the LOAD command to load your GW-Basic program.
  3. Use the LIST command to verify your program's contents.
  4. Use the SAVE command with the A option to save the program. The A switch causes the program to be saved in ASCII format. For example:
    save"<program name>",a
  5. Exit GW-Basic by typing SYSTEM at the GW-Basic prompt.
Once you have saved the program in ASCII format, you can then load theprogram in QBasic using the /MBF switch. MBF stands for MicrosoftBinary Format, which is used for floating point numbers andcalculations. It allows you to use your old programs and data withoutrewriting your programs or changing your files. For example, type thefollowing command and press ENTER:
qbasic /mbf
You can determine if your program is in ASCII format by loading theprogram into QBasic. If it has strange characters or IBM extendedcharacter set characters, the program is probably not in ASCII format.End your QBasic session and save the file in ASCII format using thesteps above.

To run the program in QBasic, from the Run menu, choose Start. If theprogram is converted to ASCII, it should run normally.
5.00 noupd

Article ID: 72502 - Last Review: 11/19/1999 06:02:00 - Revision: 1.0

  • Microsoft MS-DOS 5.0 Standard Edition
  • KB72502