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
Solved

Combing Basic With Visual Basic

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal reports - Formula Field code need assistance with code 17 81
Child Form in front 4 49
IF ELSE Statement in Excel Macro VBA 16 75
Graph API & MS Apps 1 21
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

856 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