Why is "AS Type" required?? Can't compiler figure that out??
Posted: Fri Oct 18, 2019 9:26 pm
If I have this line of code
What do I have to put "As MyFirstClass" at the end of the line? Because to the right of the = sign it tells it right there the name of the class, and perhaps even the namespace. It just seems redundant that we have to specify it. What else could it be besides that same Type?
Is this perhaps to allow support for Interfaces or some other kind of inheritance or sublassing thing that I am missing.
Since the VAR keyword could be used and it can figure it out, what can't it figure it out if we leave of the AS clause??
Code: Select all
Local oObject = myNS.MyFirstClass{} As MyFirstClass
Is this perhaps to allow support for Interfaces or some other kind of inheritance or sublassing thing that I am missing.
Since the VAR keyword could be used and it can figure it out, what can't it figure it out if we leave of the AS clause??