Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get ready for VB.NET
Message
 
To
All
General information
Forum:
Visual Basic
Category:
ActiveX controls in VFP
Title:
Get ready for VB.NET
Miscellaneous
Thread ID:
00410589
Message ID:
00410589
Views:
50
From the good people at DevX.Com:
___________________________________

Copyright 2000, Francesco Balena and DevX.com, Inc.
___________________________________

Sponsored by Improved Search on DevX.com
We've made our Search engine tremendously more valuable, whether you use VB, C++, Java, or a host of other development languages. Give us a try first when you're searching for development information.
http://www.devx.com
___________________________________

GET READY FOR VB.NET
More and more articles and books are appearing about VB7 (or VB.NET, as it goes), and it is evident that the impact on the way we use Visual Basic, or whatever you'd call the new language, will be tremendous. While you might not actually work with VB7 before it is released--about one year from now--you might save a lot of conversion headaches by consistently sticking to the following simple rules:

1) Explicitly declare ByRef and ByVal arguments to procedures (under VB.NET ByVal is the default)

2) Don't rely on default properties for controls and objects (default properties aren't supported in VB.NET)

3) Keep the declaration and the initialization of a variable on the same line, as in:
Dim X As Integer: X = 1
It makes it easier to convert them to the VB.NET syntax, that allows to declare and initialize a variable with one operation, as in:
Dim X As Integer = 1

4) Don't use auto-instancing object variables (e.g. Dim x As New CPerson)

5) Provide all your classes with a pseudo-constructor method, that takes all the arguments necessary to correctly initialize the object, for example:
Dim X As CPerson
Set X = New CPerson
X.Init FirstName, LastName, Address, City
This programming style will ease the transition to VB.NET and its 'real' constructor methods.

Of course, these tips won't make the translation automatic, but are a good step in the right direction.

--Francesco Balena (fbalena@vb2themax.com)
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Next
Reply
Map
View

Click here to load this message in the networking platform