vblang
vblang copied to clipboard
Allow With Enum, and With Class that has some shared members
I have a class named MyFlag with some static methods (and other non-static methods). Suppose I am using this code:
Dim flag = MyFlag.X
flag += MyFlag.Y
flag = flag Xor MyFlag.Z
I tried to do this:
With MyFlag
Dim flag =.X
flag +=.Y
flag = flag Xor .Z
End With
But got the error:
'MyFlag' is a class type and cannot be used as an expression.
So, I suggest to allow using classes that have some Static members in With
block. This should also include enums.
Another example:
With Console
.Clear()
.Title = "foo"
.WriteLine("bar")
End With
However, see #162 -- not sure if I'd rather see this or that (or both)