Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QBASIC IN Visual BASIC

Status
Not open for further replies.

asakap

Technical User
Feb 5, 2001
2
US
Can BASIC programs written in QBASIC (DOS) be run in VISUAL BASIC?
 
Not really. The biggest problem is that a QBasic program would be riddled with Input and Print statements. The Print statements would sort of work on a form, but it wouldn't scroll like a screen does. The Input statements wouldn't work at all. Neither would most graphics statements, SCREEN statements, or any other hardware control statements.

If you modified it to append output to a text box, and get input via InputBox calls, and it has no graphics, it might get close to working, but I'm not making any promises. And I've forgotten most of my QBasic, so I wouldn't be able to help you with it. Rick Sprague
 
I've done this with many of my old QB programs. It really isn't as hard as you might think.

Most of the difficult QB code (input, display, file handling and printing) is handled by VB. Basically, you decide where the input will come from, where the output is going and set up your app to look the way you want. Then you pull the calculation subroutines from your QB program and stick them in a VB module. Aside from the input and output methods Rick mentioned, there is very little difference between QB syntax and VB syntax ([tt]Mid$(A$,32,1) = B$[/tt] does the same thing in both languages). You just have to get used to getting input in a different way and sending the output to a message box, text box or label instead of the screen.
VCA.gif

Alt255@Vorpalcom.Intranets.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top