learn Java in 24 hours!"
...was that anything like "Learn Red Hat Linux in 21 Days" ?
Got rid of that book after two years.
See what I mean? That's the quality of all of them, pretty much.
VB6 is able to do variant types, -Right?
So it should know if you need Integer or not.
(Or am I thinking VB script.)
Just don't dim anything!. It should work anyway!
And if it goes slower, it is more fun!
[/color]
In the default configuration VB6 will allow you to not need to declare any variables. However- Standard practice is to include "Option Explicit" at the top of all Form,Class, and Code modules. This is to avoid tricky typo errors being almost impossible to catch:
Private Function Multiply(ByVal Multiplicand1,ByVal Multiplicand2,Byval Multiplicand3)
Multiply = Multiplicand1 * Multiplicand2 * Multiplicend3
end Function
notice the typo? Well, if Option Explicit is on, so will VB... otherwise it will become a puzzle why every single return from the function is 0, regardless of the input.
That was a simple example though- in far more complicated procedures it becomes torture trying to find ann the implicitly declared variables. This is why it's easier, in the long run, the declare all variables.
I only use Variant for Procedure parameters that can accept multiple types, Or when I need to use the "Decimal" type, which is only valid via Variant variables.
Also it will go MUCH slower being dimmed as Variant/Implicitly as you've stated; although that isn't the real issue, one could easily change the default variable type via a DefInt,DefLng,DefSng,DefDbl,DefStr metacommand at the top of a module... but it simply makes it easier to debug.