My QBASIC programs do not run under Windows XP. Specifically, LPRINT does nothing.
I have spent a lot of time & effort over the past 15 years programming in QBASIC with lots of useful and profitable programs. I really do not want to start over with Visual Basic unless there is a MIGRATION or CONVERSION or "CHEAT SHEET" comparing code. :(

Recommended Answers

All 41 Replies

As far as I know, QBASIC is a pretty passee language. You might consider upgrading to Visual Basic due to the simplicity to create windows applications, in addition to the fact that it is completely object oriented. Good luck!

What's LPRINTs purpose? Does it swap the lpt ports or something?

In QBASIC, the PRINT statement prints to the screen while LPRINT prints to the printer.

XP will not run 16 bit applications to my knowledge without some type of emulation service running. I dont mean to judge you as a programmer but anyone who has spent so many years programming should have the logic behind programming in general well developed mentally. It is that logic that allows programmers to do what we do. A language is merely the extension and syntax we use to express this mentality. I would highly recommend not remaining binded to one language as it helps widen your horizons as a programmer to experiment in different languages. Good luck and I hope you find something that works for you.

As far as I know, QBASIC is a pretty passee language. You might consider upgrading to Visual Basic due to the simplicity to create windows applications, in addition to the fact that it is completely object oriented. Good luck!

VB is not COMPLETELY OOP.

Polymorphism is not implemented in VB.

:D

VB is not COMPLETELY OOP.

Polymorphism is not implemented in VB.

To put it bluntly - you are wrong.

Polymorphism in VB.NET

You may have been thinking of an older version of VB, but VB.NET 7.0 (2002) and VB.NET 7.1 (2003) are 100% completely object oriented.

Sorry to break your heart - VB.NET is just as powerful as the next language.

Edit: I have now realized that the posted article is for "registered" readers only. If you want to find more about polymorphism in vb.net, google will give you a good 10,000+ results :-)

To get back on topic, there's a post located here that might be of some help:

[thread]798[/thread]

I learnt Qbasic when I took my gcse O levels under the University Of London and for IT I had to learn Qbasic.I think Qbasic is very easy and a basic type of langauge matured ppl don'treally need that at all.

I really do not want to start over with Visual Basic unless there is a MIGRATION or CONVERSION or "CHEAT SHEET" comparing code.

I started out using GW-BASIC in 1986 and moved on to QBasic. The transition from QBasic to Visual Basic, in 1997, was painless as the only thing needing to be learned was dealing with forms. I think the transition to VB, which Microsoft offers a free version (control creation edition), should be relatively painless.

Polymorphism is not implemented in VB

Actually that statement is not true. Polymorphism, meaning "the same function/routine taking many names",:

Public Function (myInt As Integer, Optional myString As String = "")

Using the optional keyword, VB is able to use the same function for several different types of tasks. This is true with VB5 and VB6 (I don't know about earlier version of VB).

Public Function (myInt As Integer, Optional myString As String = "")

That really doesn't show an example of anything. Secondly, your sytax is invalid - what is return type of the function? Heh. Next time, make sure your example compiles ;-).

DOS-Programme unter Windows XP


Qbasic unter Windows XP


Hartnkig ht sich der Standpunkt, dass DOS-Programme unter Windows XP nicht laufen. Jedoch ist der Unterschied zu freren Windows-Versionen nicht sehr gro so dass Sie MS-DOS-Programm durchaus zur Arbeit bewegen knen. Falls die Standardeinstellungen nicht richtig funktionieren, knen Sie die Einstellungen er das Dialogfeld "Eigenschaften" der ausfrbaren Datei anpassen.

Im Gegensatz zu Windows 9x-Betriebssystemen entht Windows XP jedoch keine Real-Mode-MS-DOS-Umgebung, da es nicht auf dem MS-DOS-Kern basiert.

Wenn Sie auf die ausfrbare Datei f ein DOS-Programm doppelklicken, f das keine besonderen Eigenschaften bestimmt wurden, verwendet es die Datei "_default.pif", die sich im Windows-Verzeichnis Ihrer Festplatte befindet, normalerweise also C:\Windows.

Eine PIF-Datei (PIF = Programminformationsdatei) ist die Verknfung f ein DOS-Programm, mit dem eine passende Umgebung eingerichtet wird, in dem es laufen kann. Passen Sie nun die Eigenschaften eines DOS-Programms an, so verdern Sie lediglich die PIF-Datei und nicht die der ausfrbaren Datei einer Anwendung.


So msen Sie vorgehen

Um festzulegen, dass vor dem Start des Programms eine Autoexec.bat- und eine Config.sys-Datei ausgefrt werden soll, klicken Sie auf der Registerkarte "Programm" auf die Schaltflhe "Erweitert", und geben Sie dann in den Textfeldern die Pfade zu den entsprechenden Dateien ein. Standardmig verwenden alle Programme Autoexec.nt und Config.nt, die sich beide im Ordner %SystemRoot%\System32 befinden. Um die Grundeinstellungen f alle MS-DOS-Anwendungen zu dern, knen Sie diese Dateien mit einem Texteditor bearbeiten.

Mhten Sie, dass die Anwendung auch dann weiterlft, wenn sie sich nicht im Vordergrund befindet, dann msen Sie im Register "Sonstiges" bei dem Eintrag "Hintergrund" die Option "Immer Aussetzen" aktivieren.

Falls das Programm eine Tastenkombination von Windows verwendet, hat Windows Vorrang, und Sie werden diese Tastenkombination in der Anwendung nicht benutzen knen. Soll Ihre Anwendung bei einer bestimmten Tastenkombination Vorrang erhalten, so entfernen Sie auf der Registerkarte "Sonstiges" unter "Zugriffstasten von Windows" den Haken vor aus dem entsprechenden Kontrollktchen der vor Tastenkombination.

Zeitweise stzen Programme ab, sobald sich der Windows-Bildschirmschoner einschaltet. Um das zu umgehen, deaktivierten Sie im Register "Sonstiges" unter "Vordergrund" den Eintrag "Bildschirmschoner zulassen".

Obwohl f MS-DOS kein wirklicher Kompatibilitsmodus existiert, entht, finden Sie ein Register "Kompatibilit". Als nzlich erweist sich das, wenn ein DOS-Programm unter Windows 9x gut arbeitete, unter Windows XP jedoch nicht.

Im Register "Speicher" knen Sie der Anwendung eine bestimmte Menge verschiedener Speicherarten zuweisen, beispielsweise konventionell, XMS, EMS. Hfig kontrollieren DOS-Programme wrend des Starts die Speicherkapazit um die Arbeitsfigkeit sicherzustellen. Da Windows XP aber jedem Programm den Speicherplatz je nach Bedarf zuweist, kann die Zuteilung einer bestimmten Speichermenge f das Funktionieren des jeweiligen Programms sorgen.

Umm, english please? This might be a very informative post but we have no way of knowing.

Umm, english please? This might be a very informative post but we have no way of knowing.

UMM,WHAT HE SAID WAS
QUOTE: DOS-Programme unter Windows XP
Translation
DOS-Programs under Windows XP

Qbasic unter Windows XP


The point of view keeps itself persistent that DOS programs do not run under Windows XP. However the difference to earlier Windows versions is not very large, so that you can quite induce MSDOS program to the work. If the standard attitudes do not function correctly, you can adapt the attitudes over the dialog field "characteristics" to the executable file.

Contrary to Windows 9x-Betriebssystemen Windows XP contains however no material modem DOS environment, since it is not based on the MSDOS core. If on the executable file for a DOS program doubleclicked you, for which no special characteristics were intended, it uses the file "_ default.pif", which is in the Windows listing of your non removable disk, normally thus C:\Windows. A PIF file (PIF = program information file) is the linkage for a DOS program, with which a suitable environment is furnished, in which it run can. If you adapt now the characteristics of a DOS program, then you change only the PIF file and not those the executable file of an application.So you must proceed In order to specify that before the start of the program an auto-EXEC asking and a Config.sys file are to be implemented, it clicks you on register register "program" on the switching surface "extended", and enters you then in the text fields the paths to the appropriate files.

According to standard all programs use Autoexec.nt and Config.nt, which are both in the file %SystemRoot%\System32. In order to change the basic adjustments for all applications of MSDOS, you can work on these files with a text editor. If you would like that application keeps running also if it is not in the foreground, then you must always activate "the option" in register "other" with the entry "background suspending". If the program uses a combination of keys of Windows, Windows has priority, and you will not be able to use this combination of keys in application. If your application is to receive priority with a certain combination of keys, then you remove on the register map "other" under "access keys from Windows" for the hooks forwards from the appropriate control small box before combination of keys. Occasionally programs fall, as soon as the Windows Bildschirmschoner switches itself on. In order to go around, you deactivated in register "other" under "foreground" the entry "Bildschirmschoner permit".

Although for MS-DOS no real compatibility mode exists, finds you a register "compatibility" contains. When useful that proves, if a DOS program under Windows 9x worked well, under Windows XP however not. In the register "memory" can assign you to application a certain quantity of different storage types, for example conventionally, XMS, EMS. Frequently DOS programs control the storage capacity during the start around ability to work to guarantee. Since Windows XP assigns however the storage location to each program depending upon need, the dispatching of a certain memory quantity can provide for functioning the respective program.QUOTE:

"DEUTSCHE WELLE"
Translation
"GERMAN WAVE"
Let me know if BIG B services are needed again.

:BIG"B"AfflecK

Altavista Babelfish translation:

The point of view keeps itself persistent that DOS programs do not run under Windows XP. However the difference to earlier Windows versions is not very large, so that you can quite induce MSDOS program to the work. If the standard attitudes do not function correctly, you can adapt the attitudes over the dialog field "characteristics" to the executable file. Contrary to Windows 9x-Betriebssystemen Windows XP contains however no material modem DOS environment, since it is not based on the MSDOS core. If on the executable file for a DOS program doubleclicked you, for which no special characteristics were intended, it uses the file "_ default.pif", which is in the Windows listing of your non removable disk, normally thus C:\Windows. A PIF file (PIF = program information file) is the linkage for a DOS program, with which a suitable environment is furnished, in which it run can. If you adapt now the characteristics of a DOS program, then you change only the PIF file and not those the executable file of an application. So you must proceed In order to specify that before the start of the program an auto-EXEC asking and a Config.sys file are to be implemented, it clicks you on register register "program" on the switching surface "extended", and enters you then in the text fields the paths to the appropriate files. According to standard all programs use Autoexec.nt and Config.nt, which are both in the file %SystemRoot%\System32. In order to change the basic adjustments for all applications of MSDOS, you can work on these files with a text editor. If you would like that application keeps running also if it is not in the foreground, then you must always activate "the option" in register "other" with the entry "background suspending". If the program uses a combination of keys of Windows, Windows has priority, and you will not be able to use this combination of keys in application. If your application is to receive priority with a certain combination of keys, then you remove on the register map "other" under "access keys from Windows" for the hooks forwards from the appropriate control small box before combination of keys. Occasionally programs fall, as soon as the Windows Bildschirmschoner switches itself on. In order to go around, you deactivated in register "other" under "foreground" the entry "Bildschirmschoner permit". Although for MS-DOS no real compatibility mode exists, finds you a register "compatibility" contains. When useful that proves, if a DOS program under Windows 9x worked well, under Windows XP however not. In the register "memory" can assign you to application a certain quantity of different storage types, for example conventionally, XMS, EMS. Frequently DOS programs control the storage capacity during the start around ability to work to guarantee. Since Windows XP assigns however the storage location to each program depending upon need, the dispatching of a certain memory quantity can provide for functioning the respective program.

Cool, huh. Now write your reply, and then use babelfish to translate to german!
Totally off subject, though fun to do... Anyway, I too migrated from MS-Dos-based Basic programming. I still use PowerBasic 3 from time to time, but emulation is probably the only way to go. Time to learn VB, man. :(

Drat. Somebody beat me.

Contrary to popular belief QBasic will run on any Microsoft OS after DOS 5.0.
Including Win. XP.
Maybe this guy had his printer attached to a USB Port.
When using LPRINT you must have your printer attached to the Parallel Port.

My QBASIC programs do not run under Windows XP. Specifically, LPRINT does nothing.
I have spent a lot of time & effort over the past 15 years programming in QBASIC with lots of useful and profitable programs. I really do not want to start over with Visual Basic unless there is a MIGRATION or CONVERSION or "CHEAT SHEET" comparing code. :(

I have the same problem.
Have you or anyone else found a solution?

Peter

Contrary to popular belief QBasic will run on any Microsoft OS after DOS 5.0.
Including Win. XP.
Maybe this guy had his printer attached to a USB Port.
When using LPRINT you must have your printer attached to the Parallel Port.

I have the printer plugged in to the parallel port, and I can print to it
with windows programs. It is connected to the LP1 port in the windows menu.
But, when I try to LPRINT in QBASIC , nothing happens.

Please help!

I have the printer plugged in to the parallel port, and I can print to it
with windows programs. It is connected to the LP1 port in the windows menu.
But, when I try to LPRINT in QBASIC , nothing happens.

Please help!

I belive that the problem is that Windows XP doesn't allow direct hardware-access, I. E., problems may arise when using commands, such as LPRINT, and BEEP (!).
This is not a problem with QBasic, but with all DOS-applications.

My QBASIC programs do not run under Windows XP. Specifically, LPRINT does nothing.
I have spent a lot of time & effort over the past 15 years programming in QBASIC with lots of useful and profitable programs. I really do not want to start over with Visual Basic unless there is a MIGRATION or CONVERSION or "CHEAT SHEET" comparing code. :(

Try this URL...
http://www.classifiedgroup.com/Printing%20to%20dos%20prn.htm...
I think it will help...

Qbasic is still used quite a bit. It is still taught in many schools around the country and is good for that purpose.

Many people have problems with qbasic on XP though not everyone.
I think QuickBasic compiled programs will still run (more or less) on XP.
I say more or less because some advanced things may not work well
on XP.

For tight code (as small or smaller than QuickBasic compiled code)
for the hands-on programmer I would suggest PowerBasic for Windows.

(though there are plenty of visual editors around for this too)


No Runtimes.

THE BEST forum on the internet. Questions are answered by techs from powerbasic and knowledgable users.

Not expensive.

Inline assembly code is supported too. :)

I belive that the problem is that Windows XP doesn't allow direct hardware-access, I. E., problems may arise when using commands, such as LPRINT, and BEEP (!).
This is not a problem with QBasic, but with all DOS-applications.

I recently solved this problem. I wrote some gwbasic basic programs that are still in use today. These programs used the LPRINT command heavily and all stopped working when the computer they were on was upgraded to WinXP. I changed the program by opening the printer port for file output:

OPEN "LPT1:" for OUTPUT as #1

To print use PRINT #1, "HELLO"

Follow with a CLOSE #1 to print string.

Worked for me.

I also use qbasic in windows xp and it works for me, although sometimes it freezes up, other than that the problem with the LPRINT is that with windows xp as your primary operating system it will take about 10 mins for a qbasic program to send all the info to the printer. I made a fairly simply checksum program that outputted to the printer and it printed 10 mins later, so just wait.

XP will not run 16 bit applications to my knowledge without some type of emulation service running. I dont mean to judge you as a programmer but anyone who has spent so many years programming should have the logic behind programming in general well developed mentally. It is that logic that allows programmers to do what we do. A language is merely the extension and syntax we use to express this mentality. I would highly recommend not remaining binded to one language as it helps widen your horizons as a programmer to experiment in different languages. Good luck and I hope you find something that works for you.

---------

I can't belive you flamed this poor guy. He was only asking for some help and then you pass judgement on his mentality?

Give the world a break. Everyone can't be as SUPERIOR as you.

---------

I can't belive you flamed this poor guy. He was only asking for some help and then you pass judgement on his mentality?
I wonder if he was impressed. I know I was.
Perhaps, silently, he even acknowledged your superiority.
Oh well, passing judgement on someone probably made your day.
I know mine was.

---------
I can't belive you flamed this poor guy. He was only asking for some help and then you pass judgement on his mentality?
I wonder if he was impressed. I know I was.
Perhaps, silently, he even acknowledged your superiority.
Oh well, passing judgement on someone probably made your day.
I know mine was.

The problem is: QBASIC is free and easy to write a quick program in. For someone like myself who has 2 full time jobs and a family, I have not the time or money to learn a new language. Think about that. Not all of us do nothing but program!!!!

The problem is: QBASIC is free and easy to write a quick program in. For someone like myself who has 2 full time jobs and a family, I have not the time or money to learn a new language. Think about that. Not all of us do nothing but program!!!!

Hi, I was gonna try and be snotty cause it sounds so fun, but it turned out to be too much trouble. So I decided to ANSWER your question.
all you have to do is switch from one interpreted language to another. KBasic (http://www.kbasic.org/doku.php) is fully backward compatable syntactically with QBasic. Like QBasic it requires an engine to run it...meaning that it is not compiled.

The advantage of using KBasic is that it employs the WORA model. You can write software on your PC and ship it over to Mac or Linux with the flip of a wrist. Infact, most programs I imported to KBasic from my old QBasic stash ran on both my dual boot laptop, and my OS X mac with zero modification.

Sadly the guy who developed KBasic is biased against windows users and so there is a modest charge for platforms other than Linux, but if you NEED to write in a more modern environment the cost is worth it.

another alternative is JustBasic (http://www.justbasic.com/). It seems to be a striped down version of LibertyBasic. It is fully Basic compatible, and is free. In addition the forums are full of people who seems really nice and more than willing to help. I haven't been flamed once over there.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.