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

Module question 2

Status
Not open for further replies.

shannanl

IS-IT--Management
Apr 24, 2003
1,071
US
I have a project that keeps track of patients and medical procedures related to the patients. In the project I placed a couple of modules. One for patients, one for medical procedures. In those modules I place functions or procedures that are relevant to the modules name. For instance in the patients module I have a procedure that inserts a record into the database, one that modifys a record and one that deletes a record.

Part 2. I am thinking of upgrading to vb.net and I downloaded a program by Aivosto that looks at your code and finds problems. I thought this might be a good idea before trying to upgrade my project. The problem is that it keeps telling me that all these functions and procedures in the modules are "dead procedures". It describes a "dead procedure" as "... is not used by the project. It is not called by the code nor executed by any other means..." The procedures and functions are clearly called within the program, many times. Is what I am doing bad coding or is the program that is looking for problems wrong. Well I know the program is wrong because they are clearly called from within the program but am I using bad coding techniques that is leading to this?

Thanks,

Shannan
 
Be careful about upgrading. From what I understand the only thing that VB6 and VB.Net have in common is the name (thanks to Microsoft's marketing department). VB .Net has a wizard that is suppose to migrate your code from VB6 to VB .Net. However since VB.Net does not use the same features as VB6 some things cannot be migrated by the wizard and may cause problems.

I am not trying to scare you, rather I want you make sure that you make the correct moves. Posting is a great start and I hope that I will also learn more from this thread.

Dan Appleman has a book out called 'Moving to VB .NET' that targets imtermidiate and expert VB6 (or earlier) developers. It may be worth looking at.



zemp
 
Shannan,

Have you tried using "Visual Basic 6.0 Code Advisor"? You can download it from:


It is a plug in for VB6 that comments most of the problem areas in your code. It then steps you through the comments allowing you to make changes in order to prepare it for a VB6 to .NET migration. I suggest saving your project under a different name first.

-GS
 
Thanks for the info guys. I was out of town until today so I did not get a change to respond. I will check into the Microsoft thing and see how it goes.

Thanks,

Shannan
 
I ran the add in and it found a few minor things. Mostly I use the trim(stringtotrim) function instead of trim$(stringtotrim). It suggested I use the trim$ instead of trim and left$ instead of left, etc.

I did get a couple of these:

'FIXIT: Printer object and Printers collection not upgraded to Visual Basic .NET by the Upgrade Wizard. FixIT90210ae-R5481-H1984
strDefaultprinter = Printer.DeviceName
Call SetDefaultPrinterWinNT("" & strDefaultprinter & "")

I use this to change my default printers around. It also said the Forms collection is not upgraded to VB.net. I use the forms collection to make sure each form is unloaded prior to closing the program. I am not sure what replaces these in VB.NET if anything does.

Anyway it was helpful to clean up my code some even if I can't upgrade this program to VB.NET. I learned to program on my own (reading books, trial and error, etc.) so anything that shows me a better way to do it is helpful.

Thanks again for the info.

Shannan
 
Shannan,

There is a book, "Upgrading Microsoft Visual Basic 6 to Microsoft Visual Basic .NET" that is very usefull when migrating a project. It contains a solution to the Forms Collection class you are using.

-GS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top