Solved

Combing Basic With Visual Basic

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now