I'd like to create an object... say a "Movie" object. The object should have a method name "Stop", so I can have this code below
dim Mov as new Movie
Mov.Stop ' To execute the Stop method.
In my Movie class, I should have something like this.
Sub Stop()
'code here needed for the Stop subroutine
End Sub
However, I can't use "Stop" as name as this is a reserved word. I see a VB code that has "Stop" as one of the method. Unfortunately, the code is protected so I can't view it.
How can I name a subroutine as "Stop"?
End Sub. The modifiers can specify access level and information about overloading, overriding, sharing, and shadowing. For more information, see Sub Statement.
String is not a valid Visual Basic 2012 data type. in visual basic, string is a keyword and it is useful to represent a sequential collection of characters that is called text.
In VB.NET, the Exit statement is used to terminate the loop (for, while, do, select case, etc.) or exit the loop and pass control immediately to the next statement of the termination loop.
It might work if you created a typelib with Stop and your other methods and properties and then use Implements in your class. I haven't tested this though.
Update:
See Tutorial: Using Reserved Words as VB6 Class Member Names
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With