Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Public MustOverride Function
Message
From
24/10/2002 15:00:54
Rex Mahel
Realm Software, Llc
Ohio, United States
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00714807
Message ID:
00715072
Views:
27
Thanks Cathi,

Do you have any thoughts on my other thread (712782) about subclassing an abstract component and having the Component designer tell me that I cannot subclass an abstract component?

Thanks again

Rex

>Hi Rex,
>
>The compiler knows to only look for one line of code since you can't put any code inside of the MustOverride function. You are requiring the user to create their own functionality for the method. This is similar to using an interface.
>
>>Cathi,
>>
>>So the compiler knows that either the next function/sub call or the END CLASS signifies the end of the function?
>>
>>Thanks
>>
>>Rex
>>
>>>Rex,
>>>
>>>Sorry for the misposting before. When you use the MustOverride attribute, you don't use the End Function. Here is the correct code:
>>>
>>>
>>>Public MustInherit Class Base1
>>>
>>>    Public MustOverride Function Rex() As Boolean
>>>
>>>End Class
>>>
>>>
>>>>Cathi,
>>>>
>>>>Here it is:
>>>>
>>>>
>>>>Public MustInherit Class Base1
>>>>
>>>>	Public MustOverride Function Rex() As Boolean
>>>>	End Function
>>>>
>>>>End Class
>>>>
>>>>
>>>>Thanks
>>>>
>>>>Rex
>>>>>Can you post your code?
>>>>>
>>>>>>Cathi,
>>>>>>
>>>>>>I get the same thing.
>>>>>>
>>>>>>Any more ideas?
>>>>>>
>>>>>>TIA
>>>>>>
>>>>>>Rex
>>>>>>
>>>>>>>See if you are using the following syntax:
>>>>>>>
>>>>>>>
>>>>>>>Public MustOverride Function MyFunction() As Integer
>>>>>>>  ...
>>>>>>>End Function
>>>>>>>
>>>>>>>
>>>>>>>>All,
>>>>>>>>
>>>>>>>>I cannot write a function with MustOverride. I get a blue squiggly on the End Function saying that "'End Function' must be preceded by a matching 'Function'".
>>>>>>>>
>>>>>>>>How can I do this?
>>>>>>>>
>>>>>>>>TIA
>>>>>>>>
>>>>>>>>Rex
Previous
Reply
Map
View

Click here to load this message in the networking platform