Automatically Declare and Assign in Default
Good, if i
compare (=, < ,>) an
object to another that have been already declare or assign , this first object without declaration must take the type default of the other which has been declared and assigned. this opration make short line to type. Maybe,no ?thanks.
[315 byte] By [
ANDRIAMA] at [2007-12-16]
I'm not quite sure either, but here is one way you could address it. For an optimization, I defined an explicit default value for types using Constants.
| |
Dim i1 as Integer = 1 Dim i2 as Integer = 2Const defaultInteger As Integer = 0 If i1 < i2 Then i1 = defaultInteger End If
|
If you want a more generic approach, you could use reflection to create instances of variables with defaults.
Paul Yuknewicz
Visual Basic