China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 08:47
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » Help with QBasic running under Windows XP! View 2,418 Replies 5
Original Poster Posted 2008-07-18 07:02 ·  中国 江苏 南京 鹏博士宽带
新手上路
Credits 12
Posts 4
Joined 2008-07-17 19:46
18-year member
UID 121650
Gender Male
Status Offline
The child has just started learning Qbasic, enters DOS, and runs Qbasic.exe normally. But after writing a program and executing run-start, some programs show a black screen after running, and some directly exit Qbasic without showing the running result. However, it runs normally on my office machine. Asking for help from all experts, thanks!!

My operating system is: Tomato Garden Windows XP Pro SP2 Activation-free V3.5

System information is as follows:

OS Name Microsoft Windows XP Professional
Version 5.1.2600 Service Pack 3 Build Number 2600
OS Manufacturer Microsoft Corporation
System Name CFC598C0428A49F
System Manufacturer To Be Filled By O.E.M.
System Model MCP68
System Type X86-based PC
Processor x86 Family 15 Model 107 Stepping 1 AuthenticAMD ~2094 Mhz
BIOS Version/Date American Megatrends Inc. 080014, 2007-8-28
SMBIOS Version 2.5
Windows Directory C:\WINDOWS
System Directory C:\WINDOWS\system32
Boot Device \Device\HarddiskVolume1
Region People's Republic of China
Hardware Abstraction Layer Version = "5.1.2600.5512 (xpsp.080413-2111)"
User Name CFC598C0428A49F\Administrator
Time Zone China Standard Time
Total Physical Memory 2,048.00 MB
Available Physical Memory 1.24 GB
Total Virtual Memory 2.00 GB
Available Virtual Memory 1.96 GB
Paging File Space 3.60 GB
Page File C:\pagefile.sys
Floor 2 Posted 2008-07-19 11:52 ·  中国 黑龙江 牡丹江 联通
初级用户
Credits 60
Posts 21
Joined 2008-07-17 17:00
18-year member
UID 121642
Gender Male
Status Offline
The LZ can write a Hello World program to run under XP, and surely the CMD window will flash and then disappear.
Solution: Add a pause statement in the place where you need to display the result (implemented with the getch() function in C language).
I haven't been in touch with BASIC for a long time and have almost forgotten it.
Floor 3 Posted 2008-07-19 11:55 ·  中国 黑龙江 牡丹江 联通
初级用户
Credits 60
Posts 21
Joined 2008-07-17 17:00
18-year member
UID 121642
Gender Male
Status Offline
If there is a black screen, check the settings of QBASIC. If QBASIC exits directly, modify your program code and don't let it trigger the protection mechanism of WINDOWS. Or change to another BASIC compiler. Personally, PowerBasic is recommended.
Floor 4 Posted 2008-07-20 00:31 ·  中国 江苏 南京 鹏博士宽带
新手上路
Credits 12
Posts 4
Joined 2008-07-17 19:46
18-year member
UID 121650
Gender Male
Status Offline
Thanks to friend ilbgh11 for guidance!!! There's no way to change settings in Qbasic. It's estimated to be a setting issue in the operating system, and I don't know how to change it.

I installed a DosBox 0.72 on my computer and used it to virtualize the DOS environment, and the program runs normally.

Further observation found that only those programs whose code uses screen, line, draw, play, etc. related to images and sounds don't produce results or are black screens, while other programs can still be executed. Asking everyone: How can I change the settings to completely solve this problem? Thanks!

[ Last edited by penggp on 2008-7-20 at 12:38 AM ]
Floor 5 Posted 2008-07-26 23:17 ·  中国 广东 东莞 电信
新手上路
Credits 12
Posts 6
Joined 2008-07-26 22:20
18-year member
UID 122172
Gender Male
Status Offline
Go find a "Camel" on the Linux platform. It's much better than this.
Floor 6 Posted 2008-07-27 15:39 ·  中国 黑龙江 牡丹江 联通
初级用户
Credits 60
Posts 21
Joined 2008-07-17 17:00
18-year member
UID 121642
Gender Male
Status Offline
You create a shortcut to QBASIC.EXE. In WINDOWS, the shortcut pointing to a DOS program is quite special (MS still takes care of the older programs). Right-click the shortcut icon you created, go to Properties, in the "Screen" tab, select "Full screen" in "Usage", and in the "Compatibility" tab, remove the checkmark in front of "Disable visual styles" in "Display settings". Apply and OK. Then double-click this shortcut to run QBASIC to make your settings take effect. Then run a program containing statements like screen, line draw, play, etc., and see if it works.
Forum Jump: