Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Incorporating other languages with Qbasic

Status
Not open for further replies.

Magnus01

Programmer
Jul 2, 2000
5
US
Please explain to me the process of incorporating other languages ie) C++ and ASM into Qbasic.
 
It's quite simple, really:
the most classic incorporation in qbasic that you can find is ASM. The reason is very obvious: speed!
To incorporate ASM with Qbasic you need first of all to know ASM and a ASM comiler.
You might have noticed that every time you compile a BAS file, with the new EXE file come even an OBJ file. This last file can be LINKed (With LINK.EXE) to a LIB file, that is a Qbasic Library File.
I know i mixed up things a bit, so ie:

wright your prosedure in ASM and call it let's say SAY_HI

compile your file into an EXE (SAY_HI.exe)

take the SAY_HI.OBJ and link with LINK.EXE (like this "C:/YOURQBFOLDER/LINK SAY_HI.OBJ")

after that you should have your SAY_HI.LIB to use with Qbasic (C:/YOURQBFOLDER/QB /L SAY_HI - remember you need a .BI file too to declare it with '$INCLUDE !)

finally you just use your ASM procedure by calling it like normal QB library sub!

Hope you understood something from this! :D
 
typically if the library is compiled and present to QBasic, the language differents is really not needed, if the Lib was compiled for QBasic, the compiler will understand what functions exist, and their parameters, like Alex said above best reasons for this is speed and functionality, for example there is a QB Lib floating around on the net ( I havent found the address yet ) that is a graphic library that lets you work with high speed graphics, it is of course written in ASM, and definitly helps out some Die hard Qbasic coders that want to go back to one of thier old graphical progs and enchance it with this (I would too).

In the end basically QB doesnt understand any of the other languages, it will only be presented with a libraries capabilites, and how to call them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top