Solved

Combing Basic With Visual Basic

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

707 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

13 Experts available now in Live!

Get 1:1 Help Now