|
|
|
Variants are the default type of variables that are declared without an As clause, as in: |
or are not declared at all (which is only possible if the current module does not include any Option Explicit statement). If you are recycling programs written in Visual basic 1.0 or 2.0, or even QuickBasic, you might wish to include a DefSng A-Z at the very beginning of your modules, to make Single the default type as it was in those versions of the language. But the best approach is by far is using an explicit As clause for each declared variable. A special case of this rule of thumb occurs when declaring more variables in the same line. Many developers, especially those that have programmed in C previously, are convinced that this line creates two Integer variables: |
while it actually makes x a variant variable. Since variant variables are generally much slower than Integer ones, you are going to have a performance hit if you do not pay enough attention to these details.
|
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|