Solved

Combing Basic With Visual Basic

Posted on 1998-08-13
4
178 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…

680 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