Solved

Converting QBasic to Visual Basic 4.0

Posted on 1998-08-17
3
359 Views
Last Modified: 2013-11-25
I have written a Qbasic screen saver and want to convert and compile it to VB4.0 32-bit for win95/98.  Obviously some of the commands are no longer recognized.  Is there a way to get the conversion done? a manual of sorts with approximate Qbasic/VB commands?
0
Comment
Question by:DKar
3 Comments
 
LVL 9

Accepted Solution

by:
cymbolic earned 100 total points
Comment Utility
Your basic language contstructs will map across, except for those data based statements like the Field statement, etc, but the underlying structure of your program changes in VB, since it is more an event handler than a procedural language environment.  Screen savers are entirely differrent because of their methods of interacting with the screen cooperatively in a Windows OS, such as WIN95, and in the use of the screen object.  MSDN has articles regarding writting screen savers in VB and I reccomend you get one from the Microsoft Support site.  Of course, you can still run your screen saver in a DOS mode (maybe, some graphics functions honk windows), but you probably want it integrated with the OS.
0
 
LVL 12

Expert Comment

by:mark2150
Comment Utility
About the only differences I've found between QB and VB are the lack of DATA/READ and the fact that "." is used as a separator in VB where it's a valid variable name char in QB. Most everything else goes right over. You can create a "DOS equivalent" in VB by not using any forms. Create a new project and attach you QB source to it as a .BAS module. Make the start of your code labelled:

Sub Main()

and finish off with

End Sub

Delete any forms associated with it and you should be able to compile.

M

0
 

Author Comment

by:DKar
Comment Utility
thanks to you both
cymbolic, i have checked the knowledge base, but it doesnt help in knowing how to work around the conversion very much.  mark1250 was close to the crux of the problem with the DATA/READ
remarks as that is where the debug/run stops ... on a READ command saying sub or function not defined.  also i have 5 long data strings to this proggie (a digital colored clock and calendar that can be moved to two other locations on the screen with the spacebar) (esc to exit)  any workarounds to the thing would be helpful...loading th molule without forms was very good idea, just now  the READ.  thanks again in advance
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 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

6 Experts available now in Live!

Get 1:1 Help Now