Have been asked to convert a set of programs from QBASIC to VB6. Any real pitfalls that i should watch out for? FWIW, my BASIC experience is mainly GW-BASIC and earlier. And yes, i WILL be RTFMing.


Ehem..... I guess it depends entirely on what the program does/is doing. Something very (very, very) important to keep in mind, is that VB is Built To Be OO (Object Oriented) and Event Driven. While QBasic was/is a procedural language, this could make your work a bit more difficult.

OO, is quite a bit different than QBasic, because you have to deal with objects, properties, and Methods. These are things that QBasic (or any previous version of basic) had. An Object, By Defination, is an instance of a Class. A Class is the base for an object..... you can create classes, or use existing classes, but a class is the base for any object..... so, for example, when you stick a button on your VB form, you've created an instance of the button class (you have a button object). You can change your button object all you want to, but when you stick a new button on your form, it's going to be just like the first button, before you made any changes... this is because the class never changes (the base) but once you make the object, and change the object, the object changes..... with me?

Now, these objects (a modified copy of the class) have special things that go along with them..... such as properties. These properties are things that determine how the object behaves. For example, The .Caption property will change the text that appears on the button object.... The .Width Property will change how wide (long-ways, horizontal) the button is, and the .left property will change where the left edge of that button is on the form....

Now, The kicker to the whole situation, is that the objects work on Events. Don't get me wrong, it's very possible to build a VB program that only works in 1 event (when the form loads, so, as soon as the program is run) and then terminates.... but the real issue here, is what are these programs, and how do they work now?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.