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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

converting a QBasic program to VB

Status
Not open for further replies.

steever

MIS
Mar 25, 2003
43
CA
Hi,

Anyone know of any good resources/places to start - i need to convert an old Basic program to VB.

thx in advance.

Steve
 
Memorize the screen behavior of the old program, its logical branching, etc. Make a list of what you liked as is, what you want to improve.

Study the code, correlate the code to the screen behavior.
Comment the code with changes, wish lists, etc.

Open up VB, and draw your forms. Don't think about the program, your attitude should be "Demo", not "Program".

You will need to understand when to 'jump' to another form (not many variables need to be passed) and when to run-time-modify the displayed form (Too many variables, easier to change form).

When you get your screen behaviors finalized, add the background code.

Repeat as needed.
 
I needed this for a QB2.5 prog to VB6 - talk about a culture shock. BEEP and SOUND are gone or somewhat obscure and the recommended file opening and usage is so confusing I rely on the older methods which are nearer to QB but still different. Sadly the best advice I have starts with the "learning curve" and it is steep. The object browser is less useful than the wheeze of putting object names in the watch window and clicking the + you may get too much info but it don't need much savvy to guess yer way to something useful, the concept of properties being no different from variables takes a while to sink-in but is Sooooo logical. Events are a minefield I have routines calling themselves because it is timing/sequence anarchy out there - so I use many flags like

isunloading = True (in a Form_Unload routine)

and test at critical stages with

If isunloading then Exit Sub

because routines might still be active and accessing (say) files that were closed by the unload routine. Or worse routines continue to run with little evidence - and that is mighty confusing.
But isn't all programming?
 
In my experience converting engineering, estimating and inventory QB to VB, I finally settled on the following:

Define the input and output screens by either (1) duplicating old or (2) survey users and find out what input and output would be desireable. I encourage them to give me "wish list" type things, and then I choose the easy ones.

Build the screens (forms) with buttons for actions and text boxes for output.

Copy and paste QB code into the button_click sub routines where possible, converting as much as possible to stand-alone subroutines.

Test and compare to old I/O.

Improve when time allows.

I have found that all users are much happier with VB forms and the new I/O. They also asked for many new input fields and output options, many of which were pretty easy to add in VB.

In a nutshell, what I did was to keep the code, use new I/O and make improvements where possible and timeley.
 
thx guys!

I should be able to get up and going - i'll be sure to let you know how it goes.

OR, i jes may have more questions ;-)

thx, again.

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top