Cor Ligthert [MVP]
2/2/2008 4:59:00 AM
Bill,
>>>> 8 Dim RRTPRowset As BisDataSet.RRTP_ScorecardRow()
>> Which means
>>
>>>> 8 Dim RRTPRowset As New BisDataSet.RRTP_ScorecardRow()
>
> If on row 9 he is assigning to the variable RRTPRowset , why would he
> on row 8 assign a New object to it only to discard that.
>
> There was nothing wrong with the two lines of code he wrote except that
> BisDataSet was referring to the class name when it needs to be referring
> to
> an instance (either declared inside the method or globably available)
I have never known that you can use an object as a type, however as you say
it, than it will probably be like that.
Still I keep using only classes and valuetypes when I use "AS".
Therefore the so by you beloved "Dim" is in fact here only legacy sugar AS
I have often written in other discussions with you
If there was written in VB 2008 with option Infer on,
\\Dim RRTPRowset = BisDataSet.RRTP_ScorecardRow()
///
Then I could have used it, because than it is nothing more than a result
from a method confirm the returning type of that method.
However it could in my idea be an improvement for the next version of VB as
by instance
\RRTPRowset As BisDataSet.RRTP_ScorecardRow()
///
Would be to instance a class or value in VB, in fact is nothing else needed
and giving not any breaking change because this code did never exist.
Cor