Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use "Stop" as subroutine name in VB?

Tags:

vb6

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"?

like image 633
Kratz Avatar asked Jun 08 '10 13:06

Kratz


People also ask

What is End Sub in VB?

End Sub. The modifiers can specify access level and information about overloading, overriding, sharing, and shadowing. For more information, see Sub Statement.

Which of the following is not a valid type of file in VB?

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.

How do you break a loop in VB?

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.


1 Answers

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

like image 107
Bob77 Avatar answered Sep 30 '22 13:09

Bob77