Qbasic Program

0 views
Skip to first unread message

Rosamunda Froats

unread,
Aug 3, 2024, 4:51:25 PM8/3/24
to gessbestdanna

QBasic is an integrated development environment (IDE) and interpreter for a variety of dialects of BASIC which are based on QuickBASIC. Code entered into the IDE is compiled to an intermediate representation (IR), and this IR is immediately executed on demand within the IDE.[1]

Like QuickBASIC, but unlike earlier versions of Microsoft BASIC, QBasic is a structured programming language, supporting constructs such as subroutines.[2] Line numbers, a concept often associated with BASIC, are supported for compatibility, but are not considered good form, having been replaced by descriptive line labels.[1] QBasic has limited support for user-defined data types (structures), and several primitive types used to contain strings of text or numeric data.[3][4] It supports various inbuilt functions.

QBasic was intended as a replacement for GW-BASIC. It was based on the earlier QuickBASIC 4.5 compiler but without QuickBASIC's compiler and linker elements. Version 1.0 was shipped together with MS-DOS 5.0 and higher, as well as Windows 95, Windows NT 3.x, and Windows NT 4.0. IBM recompiled QBasic and included it in PC DOS 5.x, as well as OS/2 2.0 onwards.[5] eComStation and ArcaOS, descended from OS/2 code, include QBasic 1.0. QBasic 1.1 is included with MS-DOS 6.x, and, without EDIT, in Windows 95, Windows 98 and Windows Me. Starting with Windows 2000, Microsoft no longer includes QBasic with their operating systems.[6]

QBasic (as well as the built-in MS-DOS Editor) is backwards-compatible with DOS releases prior to 5.0 (down to at least DOS 3.20). However, if used on any 8088/8086 computers, or on some 80286 computers, the QBasic program may run very slowly, or perhaps not at all, due to DOS memory size limits. Until MS-DOS 7, MS-DOS Editor and Help required QBasic: the EDIT.COM and HELP.COM programs simply started QBasic in editor and help mode only, and these can also be entered by running QBASIC.EXE with the /EDITOR and /QHELP switches (i.e., command lines QBASIC /EDITOR and QBASIC /QHELP).

Is anyone here familiar with qbasic programs and specifically programs using com ports? I'm trying to run the attached program in dosbox but whenever it gets to the OPEN COM1 line it fails with a device timeout error.
I get the same error even on a physical pc running dos, and the serial port is set up properly in dosbox.
I think the issue is that the device I'm trying to connect to doesn't send any data through the serial line unless the right command is sent to it, and I think basic is waiting for a response or something which it doesn't get. If anyone knows how to configure the program so it doesn't wait for a response before continuing, or if there is actually some other issue, I'd really appreciate the help.

By tge way, the COM port issue is also still a thing in VB6.
The serial port extension is not included in the smaller versions.
VB6 Pro or higher is required to access the serial ports.
Except if someone is willing to use a third-party library, like PORT.DLL.

In Qbasic you can use CHAIN command to pass control to another .BAS file and when it is finished it will return to the first .BAS file. You can combine it with COMMON to also share variables between the two programs.

I would like to know how to properly pipe STDOUT and STDIN to a qbasic program running on DOS 6.22. I would like my qbasic program to be able to run EEUPDATE.exe through the following line "EEUPDATEW.exe /NIC=* /FILE=I211.txt /MAC=* /INVMUPDATE" and then reads in the STDOUT posted by EEUPDATE.exe for further processing. How would I go about doing this? I have been rattling my brain all day and I can't seem to get it to work.

Well variables in programming do the same sort of thing. They are names created by the programmer to hold a value. There are two kinds we will discuss in this lesson and they are numeric variable (hold numbers) and string variable (hold strings).

Notice that I assigned the variable x to 4 and y to 2 using the equals sign. So I told the interpreter to make
x = 4 and y = 2, which resulted in a 6 when I used them with the second PRINT command. The first PRINT is used to show that the addition works both ways. It is unnecessary, so feel free to ignore it for this example.

Variables do not have to be one character long, though. As long as the variable name is less than 40 characters, you can use it, but try not to go above 10 characters. It could get annoying to continually type a long variable name. If I wanted to use seven = 7, then I could do that or I could type answer = 42. It all depends on what name will have a meaning to you. Usually it is helpful to name something after what you are using it for. For example, if I wanted to do some math, then I could do the following:
answer = 4 + 2
The variable answer would then contain the answer of the math I just did. As long as you can remember it, though, the name should be fine.

I try to tell you as much as I can so that if you get any error warnings, you will be able to understand or see what went wrong. I do not mean to bog you down with information that may seem useless. Do not forget, questions are important if you do not understand something. There is no sense in not getting it answered i you are going to keep programming.

1. Output string variable and a numeric variable to the screen without giving them a value.
2. Print out your full name using 4 string$ variables.
3. Using the order of operations, do arithmetic of your choice with 7 variables.
4. Using variables of your choice, produce the following design using different PRINT commands:

5. Try adding a numeric variable and a string variable. Does it let you even execute the program?
6. Are variables case-sensitive? Is b and B considered a different variable? Design a program to test if QBasic is case-sensitive.

The statement I used was > where ptrscr.exe y a program which capture the screen and send the data screen to the Printer. Now, under Windows XP the program does not work and I dont know why? I was thinking about updating the DOS command Graphics Graphic but I dont know if it is in Windows XP.

There was another post located here [thread]636[/thread] regarding the same question. It turns out that QBASIC is a 16-bit language, just like Windows 3.1 was. Windows 95 and above were 32-bit with 16-bit support. Starting with Windows XP, however, Microsoft has decided to strip the 16-bit support. Therefore, your Qbasic programs unfortunately won't be able to run in WindowsXP. The only option, unfortunately, is to perhaps migrate over to Visual Basic 6 or Visual Basic.NET

I have nearly no problem using qbasic in win xp, I simply load command prompt then qb.exe, and occassionaly it would freeze up, but since I changed the memory 'properties' of qb.exe to allow protected memory it works just fine, I can't see why you have a problem.

I have this EXACT same problem. I'd like to know what you changed in the memory properties to allow the program to work. I need to use this qbasic program for a school project. Your input would be greatly appreciated. Thanx! :)

Thank you very much mrwhy and cscgal for your input. I've told my teacher about it and he and I are going to either work around it or use it as an idea to customize windows xp and put in 16-bit again as a project. Once again Thank you very much!!!

THERE!!! Under recent study one member on this site suggested using DOSBox. I've combined both DOSBox-0.63 and QBasic 4.5 together to create QBasicXP. It works PERFECTLY! I have only one problem with it. The help file that tells u the codes is not working but as long as u know the codes or if u can get a tutorial from somewhere else you will be fine. Here is the link

The statement I used was > where ptrscr.exe y a program which capture the screen and send the data screen to the Printer. Now, under Windows XP the program does not work and I don?t know why? I was thinking about updating the DOS command Graphics Graphic but I don?t know if it is in Windows XP.

How do you get rid of the "pop-up"?(for want of a better word) that happens every time you try to start a program which makes it impossible to read anything where the "pop-up" occupies space. Otherwise as someone new to QBASIC, I like what I see and thank you for the hyperlink(&download).

I'm sorry but what exactly do you mean by "pop up"? Like when you run the program that you have created? (Usually just a black screen) If thats the case and you cannot exit the program, try pressing Ctrl +Break. I've updated QBasicXP so it now boots into a fullscreen with double buffering. I'm currently working on setting a permanent path for the QB45QCK.hlp file (Help File). I should have every bug worked out by March 10th. Anyone questions that need immediate response just email me at t0p_g...@yahoo.ca

hrmm I'm having quite a bit of difficulty with this Perminent Help Path Soooooo... I'm going to move on to someone elses idea of replacing autoexec.nt. I will post a program on the same site that does this separately. It will create a duplicate Autoexec.nt in the system32 folder and install QBasic v4.5. (Warning!! - I Have Not Done Any Testing On This Autoexec.nt So I'm Going to Go Through A few tests to be safe! Otherwise I will post the program at your own risk. I doubt there are any problems but then again these are system files we are dealing with so better safe then sorry :) ) Anyway I'll Keep you guys informed on the testing and progress. The Update will still take place March 10th.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages