I can make the compiler give me an error (Use of variable prior to assignment) with:
private sub Test()
Dim ord As Order
Dim ord2 As Order
ord2 = ord
end sub
but not with:
Friend Class frmReceiving
...
Private mobjOrder As Order
...
private sub Testing()
Dim ord2 As Order
ord2 = mobjOrder
end sub
How can I make it flag as error?
thanks.
Your second example is not an error. mobjOrder
will be initialized to Nothing
. You then assign Nothing
to ord2
. That's a perfectly legitimate thing to do.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.