Solved

Convert qbasic to visual basic

Posted on 1999-01-16
3
2,920 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

739 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