Solved

Combing Basic With Visual Basic

Posted on 1998-08-13
4
176 Views
Last Modified: 2013-11-25
Is it possible to combine Basic with Visual Basic.   I have a friend that has an exisitng basic program and he would like to chnage the menu system to Visual Basic, but still use the underlying basic program to do the work.  If it is possible how do I do it?
0
Comment
Question by:Sbaxt
  • 2
4 Comments
 

Author Comment

by:Sbaxt
ID: 1468737
Edited text of question
0
 
LVL 18

Accepted Solution

by:
deighton earned 200 total points
ID: 1468738
In your vb program

y$ = "c:\hello.bas"    'program path in QBASIC
x$ = "QBASIC /RUN " + y$

shell x$


This will auto run a Qbasic program  - if your using another Basic version similar command strings can be used

0
 
LVL 18

Expert Comment

by:deighton
ID: 1468739
Another point!

You will want the focus in your DOS box so in the shell command use

shell x$ ,vbMaximizedFocus

It seems to work on my PC


0
 
LVL 12

Expert Comment

by:mark2150
ID: 1468740
Depending on the version of BASIC the old original code is in it may well port directly into VB with little or no changes. I have an extensive library of old DOS QuickBasic-IV code that I was able to dump into VB as Modules with few changes. The major area of difference that I found was that QB-IV allowed period as a placeholder in a variable name where VB5 Pro uses it as a separator between an object and it's property. A little fiddling with global search and replace selectively changing the .'s into _'s cleared that right up. The only other differences I noticed was the lack of a DATA/READ structure in VB. Once those were addressed it was only a matter of moments from that to a clean compile. Set the VB project properties to start the .BAS module and surround the code with:

SUB MAIN()

Old basic here
'
END SUB

and you should have a compilable VB5 module running the old code verbatim.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

785 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