Class with function written publicly

Results 1 to 3 of 3

Thread: Class with function written publicly

  1. #1
    Join Date
    Dec 1969

    Default Class with function written publicly

    I want to write a class in VB that contains a function or sub that the user of this class is allowed to overwride.<BR><BR>This function or sub can be called in other Class funtions but is written outside the class.<BR><BR>I thought it might be a friend or a callback function but I haven&#039;t found anything that does exactly what I want.<BR><BR>Is this possible?<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default *HOW* would user override?

    VBS doesn&#039;t support inheritance, so what syntax could you possibly use that would tell the system to use a different implementation of the method???<BR><BR>OOOPS...I just saw you said "VB"! Do you really *mean* Visual Basic, instead of VBScript?<BR><BR>If so, it seems that the best thing is to do it the usual way: Inheritance.<BR><BR>To override a method, the user creates a class that inherits from your class and writes an overriding method of his/her own. That&#039;s the OO way to do it.<BR><BR>

  3. #3

    Default RE: Class with function written publicly

    Is it VB (go with Bill&#039;s reply)?<BR><BR>For VBS classes, you can make a public function that does the work of your overrideable method.<BR>Your method will call this function.<BR>When someone wants to override, the create a new implementation of the public function.<BR><BR>Sketchy, but it can work<BR><BR>-A<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts