Solved

Convert qbasic to visual basic

Posted on 1999-01-16
3
2,980 Views
Last Modified: 2013-11-25
Is there a book or other kind of publication that describes how to convert qbasic to visual basic?
0
Comment
Question by:7for7est
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
mark2150 earned 50 total points
ID: 1469000
Not that I'm aware of, but I've done the conversion and it is easy. 98% of your code will port without modification. Problem areas are:

1) QBASIC allows "." as part of variable name, VB uses this as a field separator. Change all "."'s in variables into some other character, "_" works well.

2) VB does not support the DATA/READ statements - dunno why - You'll have to use a series of explicit assigns instead.

3) VB likes to start things with a form, but you can start in a module (.BAS file) instead. Create a new project with a blank form. Change the project properties to start in SUB MAIN(). Drop the form and you'll have a "form less" VB app. Place SUB MAIN() in the start of your QBASIC source file (just past the variable declarations block, before the first executable statement. Place an END SUB at the bottom.

4) INPUT statements are passe. You should create a form with text boxes and a command button. Where you would perform input just hang out and wait for the command button to be pressed. If you need input validation use the Microsoft Masked Edit control instead of straight text box.

Biggest difference is that VB executes in non-linear fashion. VB is event driven. You won't need polling loops in your code waiting around for operator input (no more INKEY loops!). When the system is waiting on operator input *NONE* of your code should be executing! This is a different mindset, but once you get the hang of it, it is actually easier. Don't fight it, if you're trying to do something that worked in QBASIC and it seems *impossible* in VB take that as a sign that you're comming at it from the wrong direction. VB is actually easier to code in but you DO have to change your way of thinking. You've got to break out of the linear execution mold or you'll be ripping your hair out.

Write me direct if you want to chat.

    Mark_Lambert@ntsc.navy.mil

M

0
 

Author Comment

by:7for7est
ID: 1469001
Thanks much Mark2150! I first began to use basic when we got a Tandy model 100 portable computer. We have used qbasic on our 486 ever since for business purposes. Then we upgraded to Windows 98, and found that our numerous programs would not run. So we are now somewhere near the bottom of a new learning curve. We've taken it as a challenge and much appreciate your concise answer.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1469002
Glad to help. I've got a *TON* of code that I wrote in QBASIC-IV (compiled). I *STILL* use it as it generates "rock hard" standalone .EXE files that *NEVER* crash (as long as *MY CODE* is clean!) I use it for batch file based stuff and there's nothing better!

VB is great for quickly generating GUI stuff. I love the fact that it talks to Access database natively - I'll *NEVER* code another FIELD statement! (grin).

Like I said, 98% of my QB-IV code ported to VB with little tinkering. I found that in many cases it was easier to recode as VB and just lift the occassional subroutine from the QB-IV code. This allows me to rapidly build up a pretty GUI and still draw on the library of debugged subs in my QB-IV archives.

M

0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month8 days, 2 hours left to enroll

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question